[PC-BSD Commits] r2064 - pcbsd/trunk/NetworkManager

svn at pcbsd.org svn at pcbsd.org
Mon Jun 9 08:12:14 PDT 2008


Author: tim
Date: 2008-06-09 08:12:14 -0700 (Mon, 09 Jun 2008)
New Revision: 2064

Modified:
   pcbsd/trunk/NetworkManager/networkman.ui.h
Log:
Refactored for libpcbsd

Modified: pcbsd/trunk/NetworkManager/networkman.ui.h
===================================================================
--- pcbsd/trunk/NetworkManager/networkman.ui.h	2008-06-09 15:12:06 UTC (rev 2063)
+++ pcbsd/trunk/NetworkManager/networkman.ui.h	2008-06-09 15:12:14 UTC (rev 2064)
@@ -556,19 +556,9 @@
 
 QString NetworkMan::getTypeForIdent( QString ident )
 {
-    	QString command = "ifconfig " +ident + " | grep \"ssid\"";
-	QString inputLine = getLineFromCommandOutput(command);
-	QString ssid= "";
-	
-	if (inputLine != "" && inputLine.find("ssid ") != -1){
-		
-		return "Wireless";
-		
-		
-	}
-	
-	return "Ethernet";
-
+   NetworkInterface ifr(ident);
+   if (ifr.isWireless()) return "Wireless";
+   return "Ethernet";
 }
 
 
@@ -1142,16 +1132,7 @@
 
 QString NetworkMan::getUpStatusForIdent( QString ident )
 {
-        	QString command = "ifconfig " +ident + " | grep \"flags=\"";
-	QString inputLine = getLineFromCommandOutput(command);
-	QString status = "";
-	
-	if (inputLine != "" && inputLine.find("<UP") != -1){
-	    status = "UP";
-	} else {
-	    status = "DOWN";  
-	}
-	
-	return status;
-    
+   NetworkInterface ifr(ident);
+   if (ifr.isUp()) return "UP";
+   return "DOWN";
 }



More information about the Commits mailing list