[PC-BSD Commits] r17824 - pcbsd/current/src-qt4/pc-netmanager/src/NetworkTray

svn at pcbsd.org svn at pcbsd.org
Thu Jul 19 13:17:53 PDT 2012


Author: kris
Date: 2012-07-19 20:17:53 +0000 (Thu, 19 Jul 2012)
New Revision: 17824

Modified:
   pcbsd/current/src-qt4/pc-netmanager/src/NetworkTray/NetworkTray.cpp
   pcbsd/current/src-qt4/pc-netmanager/src/NetworkTray/NetworkTray.h
Log:

Change the loop that we use for monitoring network status



Modified: pcbsd/current/src-qt4/pc-netmanager/src/NetworkTray/NetworkTray.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-netmanager/src/NetworkTray/NetworkTray.cpp	2012-07-19 19:54:25 UTC (rev 17823)
+++ pcbsd/current/src-qt4/pc-netmanager/src/NetworkTray/NetworkTray.cpp	2012-07-19 20:17:53 UTC (rev 17824)
@@ -63,7 +63,7 @@
   confirmDevice(DeviceName); 
 
   // Update the ifconfig line we will be parsing
-  updateIfStatus(DeviceName);
+  slotUpdateIfStatus();
 
   // Get the MAC for this device
   DeviceMAC=getMacForIdent(DeviceName);
@@ -370,9 +370,6 @@
   QIcon Icon;
   QString NotifyText = "";
 
-  // Update the ifconfig output of this device
-  updateIfStatus(DeviceName);
-
   // Check the media status of this device
   DeviceMedia = getMediaForIdent();
 
@@ -561,12 +558,12 @@
   return ip;
 }
 
-void NetworkTray::updateIfStatus( QString ident )
+void NetworkTray::slotUpdateIfStatus()
 {
    QProcess *getIfProc = new QProcess();
-   getIfProc->start(IFCONFIG, QStringList() << ident);
+   getIfProc->start(IFCONFIG, QStringList() << DeviceName);
    while(getIfProc->state() == QProcess::Starting || getIfProc->state() == QProcess::Running) {
-      getIfProc->waitForFinished(200);
+      getIfProc->waitForFinished(500);
       QCoreApplication::processEvents();
    }
 
@@ -577,6 +574,8 @@
 
    getIfProc->kill();
    delete getIfProc;
+
+   QTimer::singleShot(UPDATE_MSEC, this,  SLOT(slotUpdateIfStatus()) );
 }
 
 void NetworkTray::slotCheckWifiAvailability(){

Modified: pcbsd/current/src-qt4/pc-netmanager/src/NetworkTray/NetworkTray.h
===================================================================
--- pcbsd/current/src-qt4/pc-netmanager/src/NetworkTray/NetworkTray.h	2012-07-19 19:54:25 UTC (rev 17823)
+++ pcbsd/current/src-qt4/pc-netmanager/src/NetworkTray/NetworkTray.h	2012-07-19 20:17:53 UTC (rev 17824)
@@ -38,6 +38,7 @@
    void slotGetNetKey(QAction* act);
    void slotQuickConnect(QString key, QString SSID);
    void slotCheckWifiAvailability();
+   void slotUpdateIfStatus();
    
 private:
    void displayTooltip();
@@ -59,7 +60,6 @@
    QString getIPv6ForIdent();
    QString getWifiParent( QString dev );
    QString getTypeForIdent( QString ident );
-   void updateIfStatus( QString ident );
    QString ifconfigOutput;
    QProcess *runCommandProc;
    QProcess *getIfProc;



More information about the Commits mailing list