diff options
author | Ken Moore <ken@pcbsd.org> | 2016-09-15 14:04:02 -0400 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2016-09-15 14:04:02 -0400 |
commit | 4e8537a11832f00b58334e805e2b9aede0fcd0ff (patch) | |
tree | e87b3b7bdb89088750551db51b79d4da090881ba /src-qt5/desktop-utils/lumina-fm/gitCompat.h | |
parent | Fix a couple compile errors in lumina-fm. (diff) | |
download | lumina-4e8537a11832f00b58334e805e2b9aede0fcd0ff.tar.gz lumina-4e8537a11832f00b58334e805e2b9aede0fcd0ff.tar.bz2 lumina-4e8537a11832f00b58334e805e2b9aede0fcd0ff.zip |
Get the Git clone functionality all functional. The last thing missing is a graphical dialog showing the status of the download.
Diffstat (limited to 'src-qt5/desktop-utils/lumina-fm/gitCompat.h')
-rw-r--r-- | src-qt5/desktop-utils/lumina-fm/gitCompat.h | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/src-qt5/desktop-utils/lumina-fm/gitCompat.h b/src-qt5/desktop-utils/lumina-fm/gitCompat.h index 44c6d5b1..a8b5bd1f 100644 --- a/src-qt5/desktop-utils/lumina-fm/gitCompat.h +++ b/src-qt5/desktop-utils/lumina-fm/gitCompat.h @@ -4,7 +4,7 @@ // Available under the 3-clause BSD license // See the LICENSE file for full details //=========================================== -// This is the backend classe for interacting with the "git" utility +// This is the backend class for interacting with the "git" utility //=========================================== #ifndef _LUMINA_FM_GIT_COMPAT_H #define _LUMINA_FM_GIT_COMPAT_H @@ -12,9 +12,35 @@ #include <QProcess> #include <QString> #include <QProcessEnvironment> - +#include <QDebug> +#include <QTemporaryFile> #include <LuminaUtils.h> +#include <unistd.h> + +class GitProcess : public QProcess{ + Q_OBJECT +private: + QString log; + QFile tmpfile; +public: + GitProcess(); + ~GitProcess(); + + //Optional Inputs + void setSSHPassword(QString pass); //This is only used for SSH access + +private slots: + void cleanup(); + void printoutput(){ qDebug() << "Proc Output:" << this->readAllStandardOutput(); } + +protected: + virtual void setupChildProcess(){ + //Need to disable the controlling terminal within this process + setsid(); //Make current process new session leader - resulting in no controlling terminal for this session + } +}; + class GIT{ public: //Check if the git utility is installed and available @@ -45,10 +71,9 @@ public: } //Setup a process for running the clone operation (so the calling process can hook up any watchers and start it when ready) - static QProcess* setupClone(QString indir, QString url, QString branch = "", int depth = -1){ + static GitProcess* setupClone(QString indir, QString url, QString branch = "", int depth = -1){ //NOTE: The returned QProcess needs to be cleaned up when finished - QProcess *P = new QProcess(); - P->setProcessEnvironment( QProcessEnvironment::systemEnvironment() ); + GitProcess *P = new GitProcess(); P->setWorkingDirectory(indir); P->setProgram("git"); QStringList args; |