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,41 +1,52 @@ | |||
1 | #include "pppconfig.h" | 1 | #include "pppconfig.h" |
2 | #include "pppmodule.h" | 2 | #include "pppmodule.h" |
3 | #include "pppdata.h" | 3 | #include "pppdata.h" |
4 | #include "kpppwidget.h" | 4 | #include "kpppwidget.h" |
5 | #include "interfaceinformationimp.h" | 5 | #include "interfaceinformationimp.h" |
6 | //#include "devices.h" | 6 | //#include "devices.h" |
7 | 7 | ||
8 | /** | 8 | /** |
9 | * Constructor, find all of the possible interfaces | 9 | * Constructor, find all of the possible interfaces |
10 | */ | 10 | */ |
11 | PPPModule::PPPModule() : Module() | 11 | PPPModule::PPPModule() : Module() |
12 | { | 12 | { |
13 | QMap<QString,QString> ifaces = PPPData::data()->getConfiguredInterfaces(); | ||
14 | QMap<QString,QString>::Iterator it; | ||
13 | Interface *iface; | 15 | Interface *iface; |
14 | iface = new Interface( 0, "device" ); | 16 | qDebug("getting interfaces"); |
15 | iface->setHardwareName( "account" ); | 17 | for( it = ifaces.begin(); it != ifaces.end(); ++it ){ |
16 | list.append( iface ); | 18 | qDebug("ifaces %s", it.key().latin1()); |
19 | iface = new Interface( 0, it.key() ); | ||
20 | iface->setHardwareName( it.data() ); | ||
21 | list.append( iface ); | ||
22 | } | ||
17 | } | 23 | } |
18 | 24 | ||
19 | /** | 25 | /** |
20 | * Delete any interfaces that we own. | 26 | * Delete any interfaces that we own. |
21 | */ | 27 | */ |
22 | PPPModule::~PPPModule(){ | 28 | PPPModule::~PPPModule(){ |
23 | Interface *i; | 29 | QMap<QString,QString> ifaces; |
24 | for ( i=list.first(); i != 0; i=list.next() ) | 30 | Interface *i; |
25 | delete i; | 31 | for ( i=list.first(); i != 0; i=list.next() ){ |
32 | ifaces.insert( i->getInterfaceName(), i->getHardwareName() ); | ||
33 | delete i; | ||
34 | } | ||
35 | PPPData::data()->setConfiguredInterfaces( ifaces ); | ||
36 | PPPData::data()->save(); | ||
26 | } | 37 | } |
27 | 38 | ||
28 | /** | 39 | /** |
29 | * Change the current profile | 40 | * Change the current profile |
30 | */ | 41 | */ |
31 | void PPPModule::setProfile(const QString &newProfile){ | 42 | void PPPModule::setProfile(const QString &newProfile){ |
32 | profile = newProfile; | 43 | profile = newProfile; |
33 | } | 44 | } |
34 | 45 | ||
35 | /** | 46 | /** |
36 | * get the icon name for this device. | 47 | * get the icon name for this device. |
37 | * @param Interface* can be used in determining the icon. | 48 | * @param Interface* can be used in determining the icon. |
38 | * @return QString the icon name (minus .png, .gif etc) | 49 | * @return QString the icon name (minus .png, .gif etc) |
39 | */ | 50 | */ |
40 | QString PPPModule::getPixmapName(Interface* ){ | 51 | QString PPPModule::getPixmapName(Interface* ){ |
41 | return "ppp"; | 52 | return "ppp"; |