-rw-r--r-- | noncore/settings/networksettings/wlan/wlanimp.cpp | 25 |
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 @@ -9,17 +9,18 @@ #include <qlabel.h> #include <qspinbox.h> #include <qradiobutton.h> #include <qcheckbox.h> #include <qtabwidget.h> #include <qcombobox.h> /* system() */ -#include <stdlib.h> +//#include <stdlib.h> +#include <opie/oprocess.h> #define WIRELESS_OPTS "/etc/pcmcia/wireless.opts" /** * Constructor, read in the wireless.opts file for parsing later. */ WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl):WLAN(parent, name, modal, fl), currentProfile("*") { interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i); @@ -220,28 +221,28 @@ void WLANImp::accept(){ // Ok settings are good here, save changeAndSaveSettingFile(); // Try to save the interfaces settings. if(!interfaceSetup->saveChanges()) return; - // Restart the device now that the settings have changed - QString initpath; - if( QDir("/etc/rc.d/init.d").exists() ) - initpath = "/etc/rc.d/init.d"; - else if( QDir("/etc/init.d").exists() ) - initpath = "/etc/init.d"; + OProcess insert; +// OProcess eject; - // It would be kinda cool if we didn't have to do this and could just to ifup/down + insert << "sh -c \"cardctl insert && cardctl eject\""; +// eject << "cardctl eject"; - if( initpath ) - system(QString("%1/pcmcia stop").arg(initpath)); - if( initpath ) - system(QString("%1/pcmcia start").arg(initpath)); +// if (!eject.start(OProcess::Block, OProcess::NoCommunication) ) { +// qWarning("could not start cardctl eject"); +// } + + if (!insert.start(OProcess::DontCare, OProcess::NoCommunication) ) { + qWarning("could not start cardctl insert"); + } // Close out the dialog QDialog::accept(); } // wlanimp.cpp |