Diffstat (limited to 'noncore/settings/networksettings/ppp/pppmodule.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/pppmodule.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/noncore/settings/networksettings/ppp/pppmodule.cpp b/noncore/settings/networksettings/ppp/pppmodule.cpp index 3a97535..7cbccc2 100644 --- a/noncore/settings/networksettings/ppp/pppmodule.cpp +++ b/noncore/settings/networksettings/ppp/pppmodule.cpp @@ -1,57 +1,68 @@ #include "pppconfig.h" #include "pppmodule.h" #include "pppdata.h" #include "kpppwidget.h" #include "interfaceinformationimp.h" //#include "devices.h" /** * Constructor, find all of the possible interfaces */ PPPModule::PPPModule() : Module() { + QMap<QString,QString> ifaces = PPPData::data()->getConfiguredInterfaces(); + QMap<QString,QString>::Iterator it; Interface *iface; - iface = new Interface( 0, "device" ); - iface->setHardwareName( "account" ); - list.append( iface ); + qDebug("getting interfaces"); + for( it = ifaces.begin(); it != ifaces.end(); ++it ){ + qDebug("ifaces %s", it.key().latin1()); + iface = new Interface( 0, it.key() ); + iface->setHardwareName( it.data() ); + list.append( iface ); + } } /** * Delete any interfaces that we own. */ PPPModule::~PPPModule(){ - Interface *i; - for ( i=list.first(); i != 0; i=list.next() ) - delete i; + QMap<QString,QString> ifaces; + Interface *i; + for ( i=list.first(); i != 0; i=list.next() ){ + ifaces.insert( i->getInterfaceName(), i->getHardwareName() ); + delete i; + } + PPPData::data()->setConfiguredInterfaces( ifaces ); + PPPData::data()->save(); } /** * Change the current profile */ void PPPModule::setProfile(const QString &newProfile){ profile = newProfile; } /** * get the icon name for this device. * @param Interface* can be used in determining the icon. * @return QString the icon name (minus .png, .gif etc) */ QString PPPModule::getPixmapName(Interface* ){ return "ppp"; } /** * Check to see if the interface i is owned by this module. * @param Interface* interface to check against * @return bool true if i is owned by this module, false otherwise. */ bool PPPModule::isOwner(Interface *i){ return list.find( i ) != -1; } /** * Create, and return the WLANConfigure Module * @return QWidget* pointer to this modules configure. */ QWidget *PPPModule::configure(Interface *i){ |