Diffstat (limited to 'noncore/settings/networksettings/ppp/pppmodule.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/pppmodule.cpp | 17 |
1 files changed, 14 insertions, 3 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 | |||
@@ -7,26 +7,37 @@ | |||
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 ){ |
18 | qDebug("ifaces %s", it.key().latin1()); | ||
19 | iface = new Interface( 0, it.key() ); | ||
20 | iface->setHardwareName( it.data() ); | ||
16 | list.append( iface ); | 21 | list.append( iface ); |
17 | } | 22 | } |
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(){ |
29 | QMap<QString,QString> ifaces; | ||
23 | Interface *i; | 30 | Interface *i; |
24 | for ( i=list.first(); i != 0; i=list.next() ) | 31 | for ( i=list.first(); i != 0; i=list.next() ){ |
32 | ifaces.insert( i->getInterfaceName(), i->getHardwareName() ); | ||
25 | delete i; | 33 | delete i; |
26 | } | 34 | } |
35 | PPPData::data()->setConfiguredInterfaces( ifaces ); | ||
36 | PPPData::data()->save(); | ||
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; |