[PC-BSD Commits] r17825 - pcbsd/current/src-qt4/libpcbsd

svn at pcbsd.org svn at pcbsd.org
Thu Jul 19 13:20:39 PDT 2012


Author: kris
Date: 2012-07-19 20:20:39 +0000 (Thu, 19 Jul 2012)
New Revision: 17825

Modified:
   pcbsd/current/src-qt4/libpcbsd/utils.cpp
Log:

When running shell commands in libpcbsd, we have to wait a moment before
doing process events, otherwise we can end up using 100% CPU in cases where
the process takes a long time



Modified: pcbsd/current/src-qt4/libpcbsd/utils.cpp
===================================================================
--- pcbsd/current/src-qt4/libpcbsd/utils.cpp	2012-07-19 20:17:53 UTC (rev 17824)
+++ pcbsd/current/src-qt4/libpcbsd/utils.cpp	2012-07-19 20:20:39 UTC (rev 17825)
@@ -567,6 +567,7 @@
    p.setProcessChannelMode(QProcess::MergedChannels);   
    p.start(cmdl[i]);
    while(p.state()==QProcess::Starting || p.state() == QProcess::Running){
+     p.waitForFinished(200);
      QCoreApplication::processEvents();
    }
    QString tmp = p.readAllStandardOutput();



More information about the Commits mailing list