@@ -88,11 +88,11 @@ Process::Process()
88
88
, mDebug(false )
89
89
{
90
90
mProcess ->setProcessChannelMode (QProcess::SeparateChannels);
91
- connect (mProcess , SIGNAL ( readyReadStandardError ()) , this , SLOT ( readyReadStandardError ()) );
92
- connect (mProcess , SIGNAL ( readyReadStandardOutput ()) , this , SLOT ( readyReadStandardOutput ()) );
93
- connect (mProcess , SIGNAL ( finished ( int , QProcess::ExitStatus)), this , SLOT ( finished ( int , QProcess::ExitStatus)) );
94
- connect (mProcess , SIGNAL ( error (QProcess::ProcessError)), this , SLOT ( error (QProcess::ProcessError)) );
95
- connect (mProcess , SIGNAL ( finished ( int , QProcess::ExitStatus)), qApp, SLOT ( quit ()) );
91
+ connect (mProcess , &QProcess:: readyReadStandardError, this , &Process:: readyReadStandardError);
92
+ connect (mProcess , &QProcess:: readyReadStandardOutput, this , &Process:: readyReadStandardOutput);
93
+ connect (mProcess , ( void (QProcess::*)( int , QProcess::ExitStatus))&QProcess::finished , this , &Process::finished );
94
+ connect (mProcess , ( void (QProcess::*)(QProcess:: ProcessError))&QProcess::error , this , &Process::error );
95
+ connect (mProcess , ( void (QProcess::*)( int , QProcess::ExitStatus))&QProcess::finished , qApp, &QCoreApplication:: quit);
96
96
97
97
if (pipe2 (pipefd, O_CLOEXEC) != 0 )
98
98
qWarning (" Could not create pipe" );
@@ -150,7 +150,7 @@ void Process::error(QProcess::ProcessError error)
150
150
analyzeBinary (mBinary );
151
151
break ;
152
152
case QProcess::Crashed:
153
- printf (" Crashed \n " );
153
+ printf (" Application crashed: %s \n " , qPrintable ( mBinary ) );
154
154
break ;
155
155
case QProcess::Timedout:
156
156
printf (" Timedout\n " );
@@ -222,12 +222,14 @@ void Process::stop()
222
222
if (kill (mDebuggee , SIGKILL) != 0 )
223
223
perror (" Could not kill debugee" );
224
224
}
225
- if (kill (-getpid (), SIGTERM) != 0 )
226
- perror (" Could not kill process group" );
227
225
228
226
mProcess ->terminate ();
229
227
if (!mProcess ->waitForFinished ())
230
228
mProcess ->kill ();
229
+
230
+ // Just for completeness terminate the whole group
231
+ // in case the application has started subprocesses
232
+ ::kill (-getpid(), SIGTERM);
231
233
}
232
234
233
235
void Process::incomingConnection (int i)
@@ -238,7 +240,7 @@ void Process::incomingConnection(int i)
238
240
239
241
void Process::setSocketNotifier (QSocketNotifier *s)
240
242
{
241
- connect (s, SIGNAL ( activated ( int )) , this , SLOT ( incomingConnection ( int )) );
243
+ connect (s, &QSocketNotifier:: activated, this , &Process:: incomingConnection);
242
244
}
243
245
244
246
void Process::setConfig (const Config &config)
0 commit comments