[PC-BSD Commits] r19697 - pcbsd/current/src-qt4/pc-netmanager/src/wificonfig

svn at pcbsd.org svn at pcbsd.org
Wed Oct 17 06:30:52 PDT 2012


Author: kris
Date: 2012-10-17 13:30:52 +0000 (Wed, 17 Oct 2012)
New Revision: 19697

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

Move to use new function in libpcbsd



Modified: pcbsd/current/src-qt4/pc-netmanager/src/wificonfig/wificonfigwidgetbase.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-netmanager/src/wificonfig/wificonfigwidgetbase.cpp	2012-10-17 13:30:42 UTC (rev 19696)
+++ pcbsd/current/src-qt4/pc-netmanager/src/wificonfig/wificonfigwidgetbase.cpp	2012-10-17 13:30:52 UTC (rev 19697)
@@ -29,40 +29,11 @@
     exit(0);
 }
 
-QString wificonfigwidgetbase::getFirstWiredDevice()
-{
-  QString tmp;
-
-  QStringList ifs = NetworkInterface::getInterfaces();
-  for ( QStringList::Iterator it = ifs.begin(); it != ifs.end(); ++it )
-  {
-     QString tmpDev = *it;
-     if (tmpDev.indexOf("lo0") == -1
-         && tmpDev.indexOf("lo1") == -1
-         && tmpDev.indexOf("lo2") == -1
-         && tmpDev.indexOf("lo3") == -1
-         && tmpDev.indexOf("fwe") == -1
-         && tmpDev.indexOf("plip") == -1
-         && tmpDev.indexOf("pfsync") == -1
-         && tmpDev.indexOf("pflog") == -1
-         && tmpDev.indexOf("wlan") == -1
-         && tmpDev.indexOf("tun") == -1)
-     {
-        NetworkInterface ifr(tmpDev);
-        if (! ifr.isWireless()) {
-          return tmpDev;
-        }
-     }
-  }
-
-  return tmp;
-}
-
 void wificonfigwidgetbase::setupWifiLagg(QString dev)
 {
   QString wiredDev, tmp;
 
-  wiredDev = getFirstWiredDevice();
+  wiredDev = NetworkInterface::getFirstWiredDevice();
 
   // If we have a valid wired device, clone the MAC of it to the wireless device
   if ( ! wiredDev.isEmpty() )
@@ -102,7 +73,7 @@
   // Enable the lagg0 interface
   Utils::setConfFileValue( "/etc/rc.conf", "cloned_interfaces", "cloned_interfaces=\"lagg0\"", -1);
 
-  wiredDev = getFirstWiredDevice();
+  wiredDev = NetworkInterface::getFirstWiredDevice();
   if ( ! wiredDev.isEmpty() )
     Utils::setConfFileValue( "/etc/rc.conf", "ifconfig_lagg0", "ifconfig_lagg0=\"laggproto failover laggport " + wiredDev + " laggport " + dev + " " + config + "\"", -1);
   else

Modified: pcbsd/current/src-qt4/pc-netmanager/src/wificonfig/wificonfigwidgetbase.h
===================================================================
--- pcbsd/current/src-qt4/pc-netmanager/src/wificonfig/wificonfigwidgetbase.h	2012-10-17 13:30:42 UTC (rev 19696)
+++ pcbsd/current/src-qt4/pc-netmanager/src/wificonfig/wificonfigwidgetbase.h	2012-10-17 13:30:52 UTC (rev 19697)
@@ -86,7 +86,6 @@
     QString getGatewayForIdent( QString ident );
     QString getMediaForIdent( QString ident );
     QString getWifiParent( QString dev );
-    QString getFirstWiredDevice();
     void saveLaggLine(QString dev, QString config);
     void setupWifiLagg(QString dev);
     QString DeviceName;



More information about the Commits mailing list