author | benmeyer <benmeyer> | 2002-10-24 20:20:12 (UTC) |
---|---|---|
committer | benmeyer <benmeyer> | 2002-10-24 20:20:12 (UTC) |
commit | 57c34f2f0b35ab13e7618ba77480c9b28b83885a (patch) (unidiff) | |
tree | 406fc6016ccea8d9d77a3b251361d11828e7afbc /noncore/settings/networksettings/wlan/wlanimp.cpp | |
parent | 013b5a78262099a55de8e7228436f2c00660e6b1 (diff) | |
download | opie-57c34f2f0b35ab13e7618ba77480c9b28b83885a.zip opie-57c34f2f0b35ab13e7618ba77480c9b28b83885a.tar.gz opie-57c34f2f0b35ab13e7618ba77480c9b28b83885a.tar.bz2 |
Fix segfault
Diffstat (limited to 'noncore/settings/networksettings/wlan/wlanimp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanimp.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/noncore/settings/networksettings/wlan/wlanimp.cpp b/noncore/settings/networksettings/wlan/wlanimp.cpp index 94c7518..45952b9 100644 --- a/noncore/settings/networksettings/wlan/wlanimp.cpp +++ b/noncore/settings/networksettings/wlan/wlanimp.cpp | |||
@@ -7,25 +7,25 @@ | |||
7 | /* system() */ | 7 | /* system() */ |
8 | #include <stdlib.h> | 8 | #include <stdlib.h> |
9 | #include <qfile.h> | 9 | #include <qfile.h> |
10 | #include <qdir.h> | 10 | #include <qdir.h> |
11 | #include <qtextstream.h> | 11 | #include <qtextstream.h> |
12 | #include <qmessagebox.h> | 12 | #include <qmessagebox.h> |
13 | #include <qlineedit.h> | 13 | #include <qlineedit.h> |
14 | #include <qspinbox.h> | 14 | #include <qspinbox.h> |
15 | #include <qradiobutton.h> | 15 | #include <qradiobutton.h> |
16 | #include <qcheckbox.h> | 16 | #include <qcheckbox.h> |
17 | #include <qregexp.h> | 17 | #include <qregexp.h> |
18 | 18 | ||
19 | WLANImp::WLANImp( QWidget* parent, const char* name):WLAN(parent, name, Qt::WDestructiveClose){ | 19 | WLANImp::WLANImp( QWidget* parent, const char* name, bool modal, WFlags fl):WLAN(parent, name, modal, fl){ |
20 | config = new Config("wireless"); | 20 | config = new Config("wireless"); |
21 | readConfig(); | 21 | readConfig(); |
22 | } | 22 | } |
23 | 23 | ||
24 | WLANImp::~WLANImp( ){ | 24 | WLANImp::~WLANImp( ){ |
25 | delete config; | 25 | delete config; |
26 | } | 26 | } |
27 | 27 | ||
28 | void WLANImp::readConfig() | 28 | void WLANImp::readConfig() |
29 | { | 29 | { |
30 | qWarning( "WLANImp::readConfig() called." ); | 30 | qWarning( "WLANImp::readConfig() called." ); |
31 | config->setGroup( "Properties" ); | 31 | config->setGroup( "Properties" ); |
@@ -92,41 +92,36 @@ bool WLANImp::writeConfig() | |||
92 | config->writeEntry( "dot11WEPDefaultKeyID", 0 ); | 92 | config->writeEntry( "dot11WEPDefaultKeyID", 0 ); |
93 | } else if( keyRadio1->isChecked() ){ | 93 | } else if( keyRadio1->isChecked() ){ |
94 | config->writeEntry( "dot11WEPDefaultKeyID", 1 ); | 94 | config->writeEntry( "dot11WEPDefaultKeyID", 1 ); |
95 | } else if( keyRadio2->isChecked() ){ | 95 | } else if( keyRadio2->isChecked() ){ |
96 | config->writeEntry( "dot11WEPDefaultKeyID", 2 ); | 96 | config->writeEntry( "dot11WEPDefaultKeyID", 2 ); |
97 | } else if( keyRadio3->isChecked() ){ | 97 | } else if( keyRadio3->isChecked() ){ |
98 | config->writeEntry( "dot11WEPDefaultKeyID", 3 ); | 98 | config->writeEntry( "dot11WEPDefaultKeyID", 3 ); |
99 | } | 99 | } |
100 | config->writeEntry( "dot11WEPDefaultKey0", keyLineEdit0->text() ); | 100 | config->writeEntry( "dot11WEPDefaultKey0", keyLineEdit0->text() ); |
101 | config->writeEntry( "dot11WEPDefaultKey1", keyLineEdit1->text() ); | 101 | config->writeEntry( "dot11WEPDefaultKey1", keyLineEdit1->text() ); |
102 | config->writeEntry( "dot11WEPDefaultKey2", keyLineEdit2->text() ); | 102 | config->writeEntry( "dot11WEPDefaultKey2", keyLineEdit2->text() ); |
103 | config->writeEntry( "dot11WEPDefaultKey3", keyLineEdit3->text() ); | 103 | config->writeEntry( "dot11WEPDefaultKey3", keyLineEdit3->text() ); |
104 | return true; | ||
104 | return writeWirelessOpts( ); | 105 | return writeWirelessOpts( ); |
105 | } | 106 | } |
106 | 107 | ||
107 | /** | 108 | /** |
108 | */ | 109 | */ |
109 | void WLANImp::accept() | 110 | void WLANImp::accept() |
110 | { | 111 | { |
111 | if ( writeConfig() ) | 112 | if ( writeConfig() ) |
112 | QDialog::accept(); | 113 | QDialog::accept(); |
113 | } | 114 | } |
114 | 115 | ||
115 | void WLANImp::done ( int r ) | ||
116 | { | ||
117 | QDialog::done ( r ); | ||
118 | close ( ); | ||
119 | } | ||
120 | |||
121 | bool WLANImp::writeWirelessOpts( QString scheme ) | 116 | bool WLANImp::writeWirelessOpts( QString scheme ) |
122 | { | 117 | { |
123 | qWarning( "WLANImp::writeWirelessOpts entered." ); | 118 | qWarning( "WLANImp::writeWirelessOpts entered." ); |
124 | QString prev = "/etc/pcmcia/wireless.opts"; | 119 | QString prev = "/etc/pcmcia/wireless.opts"; |
125 | QFile prevFile(prev); | 120 | QFile prevFile(prev); |
126 | if ( !prevFile.open( IO_ReadOnly ) ) | 121 | if ( !prevFile.open( IO_ReadOnly ) ) |
127 | return false; | 122 | return false; |
128 | 123 | ||
129 | QString tmp = "/etc/pcmcia/wireless.opts-qpe-new"; | 124 | QString tmp = "/etc/pcmcia/wireless.opts-qpe-new"; |
130 | QFile tmpFile(tmp); | 125 | QFile tmpFile(tmp); |
131 | if ( !tmpFile.open( IO_WriteOnly ) ) | 126 | if ( !tmpFile.open( IO_WriteOnly ) ) |
132 | return false; | 127 | return false; |