[PC-BSD Commits] r2657 - pcbsd/trunk/wificonfig

svn at pcbsd.org svn at pcbsd.org
Tue Aug 26 09:38:27 PDT 2008


Author: kris
Date: 2008-08-26 09:38:26 -0700 (Tue, 26 Aug 2008)
New Revision: 2657

Modified:
   pcbsd/trunk/wificonfig/wifiselectiondialog.cpp
Log:

Fixed the wifi selection dialog, it will now display found SSID's again



Modified: pcbsd/trunk/wificonfig/wifiselectiondialog.cpp
===================================================================
--- pcbsd/trunk/wificonfig/wifiselectiondialog.cpp	2008-08-26 15:55:34 UTC (rev 2656)
+++ pcbsd/trunk/wificonfig/wifiselectiondialog.cpp	2008-08-26 16:38:26 UTC (rev 2657)
@@ -45,7 +45,7 @@
     //runCommand("ifconfig " + DeviceName + " down");
     
     // Start the scan and get the output
-    line = getLineFromCommandOutput("ifconfig -v " + DeviceName + " up list scan >/tmp/.wifilist 2>/tmp/.wifilist");
+    line = getLineFromCommandOutput("ifconfig " + DeviceName + " up list scan >/tmp/.wifilist 2>/tmp/.wifilist");
 
     // Now read the output file
     QFile file( "/tmp/.wifilist" );
@@ -54,23 +54,21 @@
         while ( !stream.atEnd() ) {
                  line = stream.readLine(); // line of text excluding '\n'
 	     // exclude the header line
-	     if ( line.find("BSSID") == -1) {
+	     if ( line.indexOf("BSSID") == -1) {
 		     
 		 // Get the ssid of the network
 		 tmp = line;
-		 tmp = tmp.simplifyWhiteSpace();
+		 tmp = tmp.simplified();
 		 tmp.truncate(tmp.find(" "));
 		 ssid = tmp;
 		 
 		 // Get the signal strength of this device
 		 tmp = line;
-		 tmp = tmp.simplifyWhiteSpace();
-		 tmp = tmp.remove(tmp.findRev(" "), tmp.length() );
-		 tmp = tmp.remove(tmp.findRev(" "), tmp.length() );
-		 tmp = tmp.remove(0, tmp.findRev(" "));
+		 tmp = tmp.simplified();
+                 tmp = tmp.section(" ", 4, 4);
 		 tmp.truncate(tmp.find(":"));
-		 strength = tmp;
-		 
+                 strength = tmp;
+                 		
 		 // Add the device to the list box
 		 strength.toInt(&ok);
 		 if ( ok ) {
@@ -94,6 +92,15 @@
 		       
 		       foundItem = 1;
 		 
+	     } else {
+		       // If we didn't get the signal strength, still display the SSID
+		       FileLoad="/PCBSD/networkmanager/pics/tray_wifi.png";
+		       QImage *Icon = new QImage(FileLoad);
+		       QPixmap PixmapIcon;
+	                     PixmapIcon.convertFromImage(Icon->scaled(22,22));
+		       listWifi->insertItem(PixmapIcon, ssid + " (signal strength: unknown)" );
+		       
+		       foundItem = 1;
 	     }
 	    
 	}



More information about the Commits mailing list