Skip to content

Commit

Permalink
merge r10533 to version 1.0
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/branches/Version-1_0@10599 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Apr 19, 2009
1 parent 7b7f34d commit 99d319f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/core/qgsrunprocess.cpp
Expand Up @@ -47,9 +47,6 @@ QgsRunProcess::QgsRunProcess( const QString& action, bool capture )
// inside the capture if() statement.
connect( mProcess, SIGNAL( finished( int, QProcess::ExitStatus ) ), this, SLOT( processExit( int, QProcess::ExitStatus ) ) );

// start the process!
mProcess->start( action );

// Use QgsMessageOutput for displaying output to user
// It will delete itself when the dialog box is closed.
mOutput = QgsMessageOutput::createMessageOutput();
Expand All @@ -64,6 +61,9 @@ QgsRunProcess::QgsRunProcess( const QString& action, bool capture )
{
connect( mOutputObj, SIGNAL( destroyed() ), this, SLOT( dialogGone() ) );
}

// start the process!
mProcess->start( action );
}
else
{
Expand Down Expand Up @@ -134,6 +134,8 @@ void QgsRunProcess::dialogGone()
// class being called after it has been deleted (Qt seems not to be
// disconnecting them itself)

mOutput = 0;

disconnect( mProcess, SIGNAL( error( QProcess::ProcessError ) ), this, SLOT( processError( QProcess::ProcessError ) ) );
disconnect( mProcess, SIGNAL( readyReadStandardOutput() ), this, SLOT( stdoutAvailable() ) );
disconnect( mProcess, SIGNAL( readyReadStandardError() ), this, SLOT( stderrAvailable() ) );
Expand All @@ -146,7 +148,7 @@ void QgsRunProcess::processError( QProcess::ProcessError err )
{
if ( err == QProcess::FailedToStart )
{
QgsMessageOutput* output = QgsMessageOutput::createMessageOutput();
QgsMessageOutput* output = mOutput ? mOutput : QgsMessageOutput::createMessageOutput();
output->setMessage( tr( "Unable to run command" ) + mCommand, QgsMessageOutput::MessageText );
// Didn't work, so no need to hang around
die();
Expand Down

0 comments on commit 99d319f

Please sign in to comment.