Skip to content

Commit 99d319f

Browse files
author
jef
committed
merge r10533 to version 1.0
git-svn-id: http://svn.osgeo.org/qgis/branches/Version-1_0@10599 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 7b7f34d commit 99d319f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/core/qgsrunprocess.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ QgsRunProcess::QgsRunProcess( const QString& action, bool capture )
4747
// inside the capture if() statement.
4848
connect( mProcess, SIGNAL( finished( int, QProcess::ExitStatus ) ), this, SLOT( processExit( int, QProcess::ExitStatus ) ) );
4949

50-
// start the process!
51-
mProcess->start( action );
52-
5350
// Use QgsMessageOutput for displaying output to user
5451
// It will delete itself when the dialog box is closed.
5552
mOutput = QgsMessageOutput::createMessageOutput();
@@ -64,6 +61,9 @@ QgsRunProcess::QgsRunProcess( const QString& action, bool capture )
6461
{
6562
connect( mOutputObj, SIGNAL( destroyed() ), this, SLOT( dialogGone() ) );
6663
}
64+
65+
// start the process!
66+
mProcess->start( action );
6767
}
6868
else
6969
{
@@ -134,6 +134,8 @@ void QgsRunProcess::dialogGone()
134134
// class being called after it has been deleted (Qt seems not to be
135135
// disconnecting them itself)
136136

137+
mOutput = 0;
138+
137139
disconnect( mProcess, SIGNAL( error( QProcess::ProcessError ) ), this, SLOT( processError( QProcess::ProcessError ) ) );
138140
disconnect( mProcess, SIGNAL( readyReadStandardOutput() ), this, SLOT( stdoutAvailable() ) );
139141
disconnect( mProcess, SIGNAL( readyReadStandardError() ), this, SLOT( stderrAvailable() ) );
@@ -146,7 +148,7 @@ void QgsRunProcess::processError( QProcess::ProcessError err )
146148
{
147149
if ( err == QProcess::FailedToStart )
148150
{
149-
QgsMessageOutput* output = QgsMessageOutput::createMessageOutput();
151+
QgsMessageOutput* output = mOutput ? mOutput : QgsMessageOutput::createMessageOutput();
150152
output->setMessage( tr( "Unable to run command" ) + mCommand, QgsMessageOutput::MessageText );
151153
// Didn't work, so no need to hang around
152154
die();

0 commit comments

Comments
 (0)