[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kio/kio
From:       David Faure <faure () kde ! org>
Date:       2009-02-16 11:14:25
Message-ID: 1234782865.384569.18778.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 926813 by dfaure:

Fix startup notification not terminating on error (e.g. when launching a binary with \
a shared lib not found),  because QProcess::pid() is 0 again after the process \
terminates, so we need to store the PID that was used  for startup notification.


 M  +7 -2      krun.cpp  
 M  +1 -0      krun_p.h  


--- trunk/KDE/kdelibs/kio/kio/krun.cpp #926812:926813
@@ -1435,6 +1435,7 @@
     id(_id)
 #endif
 {
+    m_pid = 0;
     process = p;
     m_executable = executable;
     connect(process, SIGNAL(finished(int, QProcess::ExitStatus)),
@@ -1446,6 +1447,10 @@
         //         << "exitStatus=" << process->exitStatus();
         // Note that exitCode is 255 here (the first time), and 0 later on (bug?).
         slotProcessExited(255, process->exitStatus());
+    } else {
+#ifdef Q_WS_X11
+        m_pid = process->pid();
+#endif
     }
 }
 
@@ -1456,7 +1461,7 @@
 
 int KProcessRunner::pid() const
 {
-    return process ? process->pid() : 0;
+    return m_pid;
 }
 
 void KProcessRunner::terminateStartupNotification()
@@ -1464,7 +1469,7 @@
 #ifdef Q_WS_X11
     if (!id.none()) {
         KStartupInfoData data;
-        data.addPid(pid()); // announce this pid for the startup notification has \
finished +        data.addPid(m_pid); // announce this pid for the startup \
notification has finished  data.setHostname();
         KStartupInfo::sendFinish(id, data);
     }
--- trunk/KDE/kdelibs/kio/kio/krun_p.h #926812:926813
@@ -66,6 +66,7 @@
     KProcess *process;
     QString m_executable; // can be a full path
     KStartupInfoId id;
+    int m_pid;
 
     Q_DISABLE_COPY(KProcessRunner)
 };


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic