Skip to content

Commit d3a38b0

Browse files
author
jef
committedApr 11, 2009
fix #1203
git-svn-id: http://svn.osgeo.org/qgis/trunk@10533 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 29473ea commit d3a38b0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed
 

‎src/core/qgsrunprocess.cpp

Lines changed: 6 additions & 4 deletions
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();
@@ -63,6 +60,9 @@ QgsRunProcess::QgsRunProcess( const QString& action, bool capture )
6360
{
6461
connect( mOutputObj, SIGNAL( destroyed() ), this, SLOT( dialogGone() ) );
6562
}
63+
64+
// start the process!
65+
mProcess->start( action );
6666
}
6767
else
6868
{
@@ -133,6 +133,8 @@ void QgsRunProcess::dialogGone()
133133
// class being called after it has been deleted (Qt seems not to be
134134
// disconnecting them itself)
135135

136+
mOutput = 0;
137+
136138
disconnect( mProcess, SIGNAL( error( QProcess::ProcessError ) ), this, SLOT( processError( QProcess::ProcessError ) ) );
137139
disconnect( mProcess, SIGNAL( readyReadStandardOutput() ), this, SLOT( stdoutAvailable() ) );
138140
disconnect( mProcess, SIGNAL( readyReadStandardError() ), this, SLOT( stderrAvailable() ) );
@@ -145,7 +147,7 @@ void QgsRunProcess::processError( QProcess::ProcessError err )
145147
{
146148
if ( err == QProcess::FailedToStart )
147149
{
148-
QgsMessageOutput* output = QgsMessageOutput::createMessageOutput();
150+
QgsMessageOutput* output = mOutput ? mOutput : QgsMessageOutput::createMessageOutput();
149151
output->setMessage( tr( "Unable to run command %1" ).arg( mCommand ), QgsMessageOutput::MessageText );
150152
// Didn't work, so no need to hang around
151153
die();

0 commit comments

Comments
 (0)
Please sign in to comment.