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

svn at pcbsd.org svn at pcbsd.org
Wed Mar 7 18:12:16 PST 2012


Author: kenmoore
Date: 2012-03-08 02:12:15 +0000 (Thu, 08 Mar 2012)
New Revision: 15750

Modified:
   pcbsd/current/src-qt4/pc-netmanager/src/wificonfig/wificonfigwidgetbase.cpp
Log:
Fix a bug where using the "Add hidden" button to add a currently available network would cause a seg fault. The "Add hidden" functionality should now be ready for general use.



Modified: pcbsd/current/src-qt4/pc-netmanager/src/wificonfig/wificonfigwidgetbase.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-netmanager/src/wificonfig/wificonfigwidgetbase.cpp	2012-03-08 01:46:45 UTC (rev 15749)
+++ pcbsd/current/src-qt4/pc-netmanager/src/wificonfig/wificonfigwidgetbase.cpp	2012-03-08 02:12:15 UTC (rev 15750)
@@ -22,6 +22,7 @@
 #include "wificonfigwidgetbase.h"
 #include "ui_wificonfigwidgetbase.h"
 
+QString saveSSID; //need this to pass to a couple slots rather than requiring a currently available wifi
 
 void wificonfigwidgetbase::slotClose()
 {
@@ -633,7 +634,7 @@
   QString ssidc = QInputDialog::getText(this,tr("Network Name"),tr("Please enter the name of the network you wish to add"), QLineEdit::Normal,"",&ok);
   //check if a name was given
   if( ok && !ssidc.isEmpty()){
-    slotAddNewProfileSSID(ssidc);
+    slotAddNewProfileSSID(ssidc.simplified());
   }
 }
 
@@ -656,6 +657,9 @@
     //Get the Security Type
     QString sec = NetworkInterface::getWifiSecurity(ssidc,DeviceName);
 
+    //Save the SSID for the future save slots
+    saveSSID = ssidc;
+
     //Open the proper security dialog and link it to the save slots
     if(sec.contains("None")){
       slotAddNewProfileOpen(ssidc,false); //call the function to save the variables (no security settings)
@@ -677,8 +681,10 @@
 void wificonfigwidgetbase::slotWEPSave(QString newkey, int newindex, bool hexkey)
 {
   //get the ssid
-  QString line = listNewWifi->item(listNewWifi->currentRow())->text();
-  QString ssidc = line.section(" (",0,0,QString::SectionSkipEmpty);
+  //QString line = listNewWifi->item(listNewWifi->currentRow())->text();
+  //QString ssidc = line.section(" (",0,0,QString::SectionSkipEmpty);
+  QString ssidc = saveSSID;
+  saveSSID.clear();
   //Add the profile
   slotAddNewProfileWEP(ssidc,false,newkey,newindex,hexkey);
 }
@@ -686,8 +692,10 @@
 void wificonfigwidgetbase::slotWPAPSave(QString newkey)
 {
   //get the ssid
-  QString line = listNewWifi->item(listNewWifi->currentRow())->text();
-  QString ssidc = line.section(" (",0,0,QString::SectionSkipEmpty);
+  //QString line = listNewWifi->item(listNewWifi->currentRow())->text();
+  //QString ssidc = line.section(" (",0,0,QString::SectionSkipEmpty);
+  QString ssidc = saveSSID;
+  saveSSID.clear();
   //Add the profile
   slotAddNewProfileWPA(ssidc,false,newkey);
 }



More information about the Commits mailing list