00001
00002
00003
00004
00005
00006
00007 #ifndef MYPROCESS_H
00008 #define MYPROCESS_H
00009
00010 #include <qprocess.h>
00011 #include "git.h"
00012
00013 class Git;
00014
00015
00016
00017 class MyProcess : public QProcess {
00018 Q_OBJECT
00019 public:
00020 MyProcess(QObject *go, Git* g, const QString& wd, bool reportErrors);
00021 bool runSync(SCRef runCmd, QByteArray* runOutput, QObject* rcv, SCRef buf, QStringList* env);
00022 bool runAsync(SCRef rc, QObject* rcv, SCRef buf, QStringList* env);
00023 static const QStringList splitArgList(SCRef cmd);
00024
00025 signals:
00026 void procDataReady(const QByteArray&);
00027 void eof();
00028
00029 public slots:
00030 void on_cancel();
00031
00032 private slots:
00033 void on_readyReadStdout();
00034 void on_readyReadStderr();
00035 void on_processExited();
00036 void on_launchFinished();
00037
00038 private:
00039 void setupSignals();
00040 void appendSystemEnvironment(QStringList* env);
00041 bool launchMe(SCRef runCmd, SCRef buf, QStringList* env);
00042 void sendErrorMsg(bool notStarted = false);
00043 static void restoreSpaces(QString& newCmd, SCRef sepChar);
00044
00045 QObject* guiObject;
00046 Git* git;
00047 QString runCmd;
00048 QByteArray* runOutput;
00049 QString workDir;
00050 QObject* receiver;
00051 bool errorReportingEnabled;
00052 bool canceling;
00053 bool busy;
00054 bool exitStatus;
00055 bool async;
00056 bool isLaunching;
00057 };
00058
00059 #endif