From f196ea87989e6f51463a5beb5a37139d6e019a74 Mon Sep 17 00:00:00 2001 From: kergoth Date: Thu, 27 Mar 2003 21:01:33 +0000 Subject: Switch from 1) calling /etc/init.d/pcmcia to calling cardctl eject, cardctl insert.. and 2) OProcess instead of system() --- (limited to 'noncore/settings') 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 @@ #include /* system() */ -#include +//#include +#include #define WIRELESS_OPTS "/etc/pcmcia/wireless.opts" @@ -225,19 +226,19 @@ void WLANImp::accept(){ 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 - - if( initpath ) - system(QString("%1/pcmcia stop").arg(initpath)); - if( initpath ) - system(QString("%1/pcmcia start").arg(initpath)); + insert << "sh -c \"cardctl insert && cardctl eject\""; +// eject << "cardctl eject"; + +// 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(); -- cgit v0.9.0.2