[QGIS Commit] r8989 - trunk/qgis/src/core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Aug 5 03:19:19 EDT 2008


Author: gjm
Date: 2008-08-05 03:19:18 -0400 (Tue, 05 Aug 2008)
New Revision: 8989

Modified:
   trunk/qgis/src/core/qgsrunprocess.cpp
Log:
Apply patch provided by smizumo (#989). Also fixes ticket #1203.


Modified: trunk/qgis/src/core/qgsrunprocess.cpp
===================================================================
--- trunk/qgis/src/core/qgsrunprocess.cpp	2008-08-04 14:13:11 UTC (rev 8988)
+++ trunk/qgis/src/core/qgsrunprocess.cpp	2008-08-05 07:19:18 UTC (rev 8989)
@@ -24,6 +24,7 @@
 #include "qgslogger.h"
 #include "qgsmessageoutput.h"
 #include <QProcess>
+#include <QMessageBox>
 
 QgsRunProcess::QgsRunProcess(const QString& action, bool capture)
   : mProcess(NULL), mOutput(NULL)
@@ -45,13 +46,10 @@
     // the output from the process, hence this connect() call is
     // inside the capture if() statement.
     connect(mProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(processExit(int,QProcess::ExitStatus)));
-  }
 
-  // start the process!
-  mProcess->start(action);
+    // start the process!
+    mProcess->start(action);
   
-  if (capture)
-  {
     // Use QgsMessageOutput for displaying output to user
     // It will delete itself when the dialog box is closed.
     mOutput = QgsMessageOutput::createMessageOutput();
@@ -69,6 +67,12 @@
   }
   else
   {
+      if ( ! mProcess->startDetached(action) ) // let the program run by itself
+      {
+	  QMessageBox::critical(0, tr("Action"),
+				tr("Unable to run command") + "\n" + action
+				, QMessageBox::Ok, Qt::NoButton);
+      }
     // We're not capturing the output from the process, so we don't
     // need to exist anymore.
     die();



More information about the QGIS-commit mailing list