Skip to content

Commit 1b378f6

Browse files
author
gjm
committed
Apply patch provided by smizumo (#989). Also fixes ticket #1203.
git-svn-id: http://svn.osgeo.org/qgis/trunk@8989 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent f07b63b commit 1b378f6

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/core/qgsrunprocess.cpp

+9-5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "qgslogger.h"
2525
#include "qgsmessageoutput.h"
2626
#include <QProcess>
27+
#include <QMessageBox>
2728

2829
QgsRunProcess::QgsRunProcess(const QString& action, bool capture)
2930
: mProcess(NULL), mOutput(NULL)
@@ -45,13 +46,10 @@ QgsRunProcess::QgsRunProcess(const QString& action, bool capture)
4546
// the output from the process, hence this connect() call is
4647
// inside the capture if() statement.
4748
connect(mProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(processExit(int,QProcess::ExitStatus)));
48-
}
4949

50-
// start the process!
51-
mProcess->start(action);
50+
// start the process!
51+
mProcess->start(action);
5252

53-
if (capture)
54-
{
5553
// Use QgsMessageOutput for displaying output to user
5654
// It will delete itself when the dialog box is closed.
5755
mOutput = QgsMessageOutput::createMessageOutput();
@@ -69,6 +67,12 @@ QgsRunProcess::QgsRunProcess(const QString& action, bool capture)
6967
}
7068
else
7169
{
70+
if ( ! mProcess->startDetached(action) ) // let the program run by itself
71+
{
72+
QMessageBox::critical(0, tr("Action"),
73+
tr("Unable to run command") + "\n" + action
74+
, QMessageBox::Ok, Qt::NoButton);
75+
}
7276
// We're not capturing the output from the process, so we don't
7377
// need to exist anymore.
7478
die();

0 commit comments

Comments
 (0)