@@ -137,6 +137,8 @@ bool GitUIProxy::launchAuthCommand(QStringList Args, const QString& FromUrl, con
137137{
138138 if (FromUrl.isEmpty () || ToPath.isEmpty ())
139139 {
140+ // TODO for non GUI interface, find a way to redirect error/info
141+ // std::cout << "Empty remote url or empty destination path" << std::endl;
140142 emit error (tr (" Empty remote url or empty destination path" ));
141143 return false ;
142144 }
@@ -149,6 +151,7 @@ bool GitUIProxy::launchAuthCommand(QStringList Args, const QString& FromUrl, con
149151 openfluid::tools::FilesystemPath ({WorkingDirectory.toStdString (), " .git" , " index.lock" });
150152 if (GitIndexLockPath.exists ())
151153 {
154+ // std::cout << "Can not operate, git lock detected:" << std::endl;
152155 emit error (tr (" Can not operate, git lock detected." ));
153156 return false ;
154157 }
@@ -199,13 +202,30 @@ bool GitUIProxy::launchAuthCommand(QStringList Args, const QString& FromUrl, con
199202 connect (mp_Process, SIGNAL (readyReadStandardOutput ()), this , SLOT (processStandardOutput ()));
200203 connect (mp_Process, SIGNAL (readyReadStandardError ()), this , SLOT (processErrorOutputAsInfo ()));
201204
202- mp_Process->start (QString::fromStdString (m_ExecutablePath),Args);
203-
205+ // TO BE USED IN INTERNAL LOGGING STACK AS "INFO"
206+ // std::cout << "PROCESS START:" << m_LocalGitProgram << " : ";
207+ // for (auto& p : Args)
208+ // {
209+ // std::cout << " " << p.toStdString() << std::endl;
210+ // }
211+ // std::cout << std::endl;
212+ mp_Process->start (QString::fromStdString (m_LocalGitProgram),Args);
213+ if (!mp_Process->waitForStarted ())
214+ {
215+ delete mp_Process;
216+ mp_Process = nullptr ;
217+ // std::cout << "failed start:" << std::endl; TODO add to logging
218+ return false ;
219+ }
220+ // std::cout << "PROCESS POST START" << std::endl;
204221 mp_Process->waitForFinished (-1 );
205222 mp_Process->waitForReadyRead (-1 );
206223
207224 QString Res = QString::fromUtf8 (mp_Process->readAll ());
225+
226+ // std::cout << "PROCESS READ" << Res.toStdString() << std::endl;
208227 int ErrCode = mp_Process->exitCode ();
228+ // !std::cout << "EXIT:" << ErrCode << std::endl;
209229
210230 delete mp_Process;
211231 mp_Process = nullptr ;
@@ -298,11 +318,7 @@ std::pair<bool, QString> GitUIProxy::removeSubmodule(const QString& MainPathStr
298318 QProcess* Process = new QProcess ();
299319 Process->setWorkingDirectory (MainPathString);
300320
301- #if (QT_VERSION_MAJOR < 6)
302- Process->start (QString::fromStdString (m_ExecutablePath),{" rm" , " --cached" , " .gitmodules" });
303- #else
304- Process->start (QString::fromStdString (m_ExecutablePath),{" rm" , " --cached" , " .gitmodules" });
305- #endif
321+ Process->start (QString::fromStdString (m_LocalGitProgram),{" rm" , " --cached" , " .gitmodules" });
306322 Process->waitForReadyRead (-1 );
307323 Process->waitForFinished (-1 );
308324 int ErrCode = Process->exitCode ();
@@ -326,6 +342,7 @@ std::pair<bool, QString> GitUIProxy::removeSubmodule(const QString& MainPathStr
326342 {
327343 StandardOutput += tr (" Submodule successfully removed" );
328344 }
345+ // TODO for logging system std::cout << "OUT IN REMOVE:" << StandardOutput.toStdString() << std::endl;
329346 return std::pair (SummaryStatusCode, StandardOutput);
330347}
331348
@@ -470,11 +487,7 @@ std::pair<int, QString> GitUIProxy::launchLocalCommand(const QString& Path, QStr
470487 QProcess LocalProcess;
471488 LocalProcess.setWorkingDirectory (Path);
472489
473- #if (QT_VERSION_MAJOR < 6)
474- LocalProcess.start (QString::fromStdString (m_ExecutablePath),Args);
475- #else
476- LocalProcess.start (QString::fromStdString (m_ExecutablePath),Args);
477- #endif
490+ LocalProcess.start (QString::fromStdString (m_LocalGitProgram),Args);
478491
479492 LocalProcess.waitForReadyRead (-1 );
480493 LocalProcess.waitForFinished (-1 );
0 commit comments