summaryrefslogtreecommitdiff
authorkergoth <kergoth>2003-03-27 21:01:33 (UTC)
committer kergoth <kergoth>2003-03-27 21:01:33 (UTC)
commitf196ea87989e6f51463a5beb5a37139d6e019a74 (patch) (unidiff)
tree16fc44e33be1e678c736db4f660784df79b5fc00
parentbff145f5cced95c742deefcd607932a9f3728dd3 (diff)
downloadopie-f196ea87989e6f51463a5beb5a37139d6e019a74.zip
opie-f196ea87989e6f51463a5beb5a37139d6e019a74.tar.gz
opie-f196ea87989e6f51463a5beb5a37139d6e019a74.tar.bz2
Switch from 1) calling /etc/init.d/pcmcia to calling cardctl eject, cardctl insert..
and 2) OProcess instead of system()
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/noncore/settings/networksettings/wlan/wlanimp.cpp b/noncore/settings/networksettings/wlan/wlanimp.cpp
index 1782c22..db03266 100644
--- a/noncore/settings/networksettings/wlan/wlanimp.cpp
+++ b/noncore/settings/networksettings/wlan/wlanimp.cpp
@@ -14,7 +14,8 @@
14#include <qcombobox.h> 14#include <qcombobox.h>
15 15
16/* system() */ 16/* system() */
17#include <stdlib.h> 17//#include <stdlib.h>
18#include <opie/oprocess.h>
18 19
19#define WIRELESS_OPTS "/etc/pcmcia/wireless.opts" 20#define WIRELESS_OPTS "/etc/pcmcia/wireless.opts"
20 21
@@ -225,19 +226,19 @@ void WLANImp::accept(){
225 if(!interfaceSetup->saveChanges()) 226 if(!interfaceSetup->saveChanges())
226 return; 227 return;
227 228
228 // Restart the device now that the settings have changed 229 OProcess insert;
229 QString initpath; 230// OProcess eject;
230 if( QDir("/etc/rc.d/init.d").exists() )
231 initpath = "/etc/rc.d/init.d";
232 else if( QDir("/etc/init.d").exists() )
233 initpath = "/etc/init.d";
234 231
235 // It would be kinda cool if we didn't have to do this and could just to ifup/down 232 insert << "sh -c \"cardctl insert && cardctl eject\"";
233// eject << "cardctl eject";
236 234
237 if( initpath ) 235// if (!eject.start(OProcess::Block, OProcess::NoCommunication) ) {
238 system(QString("%1/pcmcia stop").arg(initpath)); 236// qWarning("could not start cardctl eject");
239 if( initpath ) 237// }
240 system(QString("%1/pcmcia start").arg(initpath)); 238
239 if (!insert.start(OProcess::DontCare, OProcess::NoCommunication) ) {
240 qWarning("could not start cardctl insert");
241 }
241 242
242 // Close out the dialog 243 // Close out the dialog
243 QDialog::accept(); 244 QDialog::accept();