Diffstat (limited to 'noncore/settings/networksettings/wlan/wlanimp.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanimp.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/noncore/settings/networksettings/wlan/wlanimp.cpp b/noncore/settings/networksettings/wlan/wlanimp.cpp index 80a9927..fe7941d 100644 --- a/noncore/settings/networksettings/wlan/wlanimp.cpp +++ b/noncore/settings/networksettings/wlan/wlanimp.cpp | |||
@@ -36,25 +36,25 @@ WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, W | |||
36 | if (file.open(IO_ReadOnly)){ | 36 | if (file.open(IO_ReadOnly)){ |
37 | QTextStream stream( &file ); | 37 | QTextStream stream( &file ); |
38 | QString line = ""; | 38 | QString line = ""; |
39 | while ( !stream.eof() ) { | 39 | while ( !stream.eof() ) { |
40 | line += stream.readLine(); | 40 | line += stream.readLine(); |
41 | line += "\n"; | 41 | line += "\n"; |
42 | } | 42 | } |
43 | file.close(); | 43 | file.close(); |
44 | settingsFileText = QStringList::split("\n", line, true); | 44 | settingsFileText = QStringList::split("\n", line, true); |
45 | parseSettingFile(); | 45 | parseSettingFile(); |
46 | } | 46 | } |
47 | else | 47 | else |
48 | qDebug(QString("WLANImp: Can't open file: %1 for reading.").arg(wlanFile).latin1()); | 48 | odebug << QString("WLANImp: Can't open file: %1 for reading.").arg(wlanFile).latin1() << oendl; |
49 | connect(networkType, SIGNAL(activated(int)), this, SLOT(typeChanged(int))); | 49 | connect(networkType, SIGNAL(activated(int)), this, SLOT(typeChanged(int))); |
50 | } | 50 | } |
51 | 51 | ||
52 | void WLANImp::typeChanged(int mod){ | 52 | void WLANImp::typeChanged(int mod){ |
53 | networkChannel->setEnabled(mod); | 53 | networkChannel->setEnabled(mod); |
54 | channelLabel->setEnabled(mod); | 54 | channelLabel->setEnabled(mod); |
55 | } | 55 | } |
56 | 56 | ||
57 | /** | 57 | /** |
58 | * Change the profile for both wireless settings and network settings. | 58 | * Change the profile for both wireless settings and network settings. |
59 | */ | 59 | */ |
60 | void WLANImp::setProfile(const QString &profile){ | 60 | void WLANImp::setProfile(const QString &profile){ |
@@ -137,25 +137,25 @@ void WLANImp::parseSettingFile(){ | |||
137 | } | 137 | } |
138 | } | 138 | } |
139 | 139 | ||
140 | /** | 140 | /** |
141 | * Saves settings to the wireless.opts file using the current profile | 141 | * Saves settings to the wireless.opts file using the current profile |
142 | */ | 142 | */ |
143 | void WLANImp::changeAndSaveSettingFile(){ | 143 | void WLANImp::changeAndSaveSettingFile(){ |
144 | QString wlanFile = WIRELESS_OPTS; | 144 | QString wlanFile = WIRELESS_OPTS; |
145 | QFile::remove(wlanFile); | 145 | QFile::remove(wlanFile); |
146 | QFile file(wlanFile); | 146 | QFile file(wlanFile); |
147 | 147 | ||
148 | if (!file.open(IO_ReadWrite)){ | 148 | if (!file.open(IO_ReadWrite)){ |
149 | qDebug(QString("WLANImp::changeAndSaveSettingFile(): Can't open file: %1 for writing.").arg(wlanFile).latin1()); | 149 | odebug << QString("WLANImp::changeAndSaveSettingFile(): Can't open file: %1 for writing.").arg(wlanFile).latin1() << oendl; |
150 | return; | 150 | return; |
151 | } | 151 | } |
152 | 152 | ||
153 | QTextStream stream( &file ); | 153 | QTextStream stream( &file ); |
154 | bool foundCase = false; | 154 | bool foundCase = false; |
155 | bool found = false; | 155 | bool found = false; |
156 | bool output = true; | 156 | bool output = true; |
157 | for ( QStringList::Iterator it = settingsFileText.begin(); it != settingsFileText.end(); ++it ) { | 157 | for ( QStringList::Iterator it = settingsFileText.begin(); it != settingsFileText.end(); ++it ) { |
158 | QString line = (*it).simplifyWhiteSpace(); | 158 | QString line = (*it).simplifyWhiteSpace(); |
159 | if(line.contains("case")) | 159 | if(line.contains("case")) |
160 | foundCase = true; | 160 | foundCase = true; |
161 | // See if we found our scheme to write or the sceme couldn't be found | 161 | // See if we found our scheme to write or the sceme couldn't be found |
@@ -227,19 +227,19 @@ void WLANImp::accept(){ | |||
227 | changeAndSaveSettingFile(); | 227 | changeAndSaveSettingFile(); |
228 | 228 | ||
229 | // Try to save the interfaces settings. | 229 | // Try to save the interfaces settings. |
230 | if(!interfaceSetup->saveChanges()) | 230 | if(!interfaceSetup->saveChanges()) |
231 | return; | 231 | return; |
232 | 232 | ||
233 | OProcess insert; | 233 | OProcess insert; |
234 | insert << "sh"; | 234 | insert << "sh"; |
235 | insert << "-c"; | 235 | insert << "-c"; |
236 | insert << "cardctl eject && cardctl insert"; | 236 | insert << "cardctl eject && cardctl insert"; |
237 | 237 | ||
238 | if (!insert.start(OProcess::DontCare, OProcess::NoCommunication) ) { | 238 | if (!insert.start(OProcess::DontCare, OProcess::NoCommunication) ) { |
239 | qWarning("could not start cardctl"); | 239 | owarn << "could not start cardctl" << oendl; |
240 | } | 240 | } |
241 | 241 | ||
242 | // Close out the dialog | 242 | // Close out the dialog |
243 | QDialog::accept(); | 243 | QDialog::accept(); |
244 | } | 244 | } |
245 | 245 | ||