[PC-BSD Commits] r5790 - pcbsd/trunk/pcbsd-netmanager/src/NetworkTray

svn at pcbsd.org svn at pcbsd.org
Tue Jan 5 13:35:22 PST 2010


Author: kris
Date: 2010-01-05 13:35:21 -0800 (Tue, 05 Jan 2010)
New Revision: 5790

Modified:
   pcbsd/trunk/pcbsd-netmanager/src/NetworkTray/NetworkTray.cpp
   pcbsd/trunk/pcbsd-netmanager/src/NetworkTray/NetworkTray.h
Log:

Clean up some warnings, and fix a pontential qprocess bug



Modified: pcbsd/trunk/pcbsd-netmanager/src/NetworkTray/NetworkTray.cpp
===================================================================
--- pcbsd/trunk/pcbsd-netmanager/src/NetworkTray/NetworkTray.cpp	2010-01-05 20:42:19 UTC (rev 5789)
+++ pcbsd/trunk/pcbsd-netmanager/src/NetworkTray/NetworkTray.cpp	2010-01-05 21:35:21 UTC (rev 5790)
@@ -327,9 +327,7 @@
 void  NetworkTray::monitorStatus() {
   // Start checking to see if the device has changed, and if it has inform the user
   QString tmp;  
-  int updateTooltip = 0;
   QIcon Icon;
-  QIcon Icon2;
   QString NotifyText = "";
   QString filename = "/home/" + username + "/.kde4/Autostart/tray-" + DeviceName + ".desktop";
 
@@ -566,10 +564,12 @@
 
 void NetworkTray::updateIfStatus( QString ident )
 {
-   ifconfigOutput.clear();
-   QProcess p;
-   p.start(QString("ifconfig"), QStringList() << ident);
-   if (p.waitForFinished())
-     ifconfigOutput = p.readAllStandardOutput().simplified();
+   QProcess *getIfProc = new QProcess();
+   getIfProc->start(QString("ifconfig"), QStringList() << ident);
+   if (getIfProc->waitForFinished()) {
+     ifconfigOutput.clear();
+     ifconfigOutput = getIfProc->readAllStandardOutput().simplified();
+   }
    //qDebug() << "ifconfig output: " << ifconfigOutput <<"\n";
+   getIfProc->kill();
 }

Modified: pcbsd/trunk/pcbsd-netmanager/src/NetworkTray/NetworkTray.h
===================================================================
--- pcbsd/trunk/pcbsd-netmanager/src/NetworkTray/NetworkTray.h	2010-01-05 20:42:19 UTC (rev 5789)
+++ pcbsd/trunk/pcbsd-netmanager/src/NetworkTray/NetworkTray.h	2010-01-05 21:35:21 UTC (rev 5790)
@@ -53,5 +53,6 @@
    void updateIfStatus( QString ident );
    QString ifconfigOutput;
    QProcess *runCommandProc;
+   QProcess *getIfProc;
 
 };



More information about the Commits mailing list