author | benmeyer <benmeyer> | 2002-10-18 15:40:50 (UTC) |
---|---|---|
committer | benmeyer <benmeyer> | 2002-10-18 15:40:50 (UTC) |
commit | c16dcab3fe45ae7193cbdfb2f62bf7e5482d449b (patch) (unidiff) | |
tree | 39e69706b24b032364ad4483d2f33688e7054390 /noncore/net/networksetup/interfacesetupimp.cpp | |
parent | 0910b94b5b6618c84b3eb6c457c9137d63a7277f (diff) | |
download | opie-c16dcab3fe45ae7193cbdfb2f62bf7e5482d449b.zip opie-c16dcab3fe45ae7193cbdfb2f62bf7e5482d449b.tar.gz opie-c16dcab3fe45ae7193cbdfb2f62bf7e5482d449b.tar.bz2 |
Profiles copy
Diffstat (limited to 'noncore/net/networksetup/interfacesetupimp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/networksetup/interfacesetupimp.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/noncore/net/networksetup/interfacesetupimp.cpp b/noncore/net/networksetup/interfacesetupimp.cpp index c16d821..bdbdfde 100644 --- a/noncore/net/networksetup/interfacesetupimp.cpp +++ b/noncore/net/networksetup/interfacesetupimp.cpp | |||
@@ -86,32 +86,37 @@ bool InterfaceSetupImp::saveSettings(){ | |||
86 | 86 | ||
87 | /** | 87 | /** |
88 | * The Profile has changed. | 88 | * The Profile has changed. |
89 | * @profile the new profile. | 89 | * @profile the new profile. |
90 | */ | 90 | */ |
91 | void InterfaceSetupImp::setProfile(const QString &profile){ | 91 | void InterfaceSetupImp::setProfile(const QString &profile){ |
92 | QString newInterfaceName = interface->getInterfaceName() + profile; | 92 | QString newInterfaceName = interface->getInterfaceName(); |
93 | 93 | if(profile.length() > 0) | |
94 | newInterfaceName += "_" + profile; | ||
95 | qDebug( newInterfaceName.latin1()); | ||
94 | // See if we have to make a interface. | 96 | // See if we have to make a interface. |
95 | if(!interfaces->setInterface(newInterfaceName)){ | 97 | if(!interfaces->setInterface(newInterfaceName)){ |
96 | interfaces->addInterface(newInterfaceName, INTERFACES_FAMILY_INET, INTERFACES_METHOD_DHCP); | ||
97 | if(!interfaces->setInterface(newInterfaceName)){ | ||
98 | qDebug("InterfaceSetupImp: Added interface, but still can't set."); | ||
99 | return; | ||
100 | } | ||
101 | // Add making for this new interface if need too | 98 | // Add making for this new interface if need too |
102 | if(profile != ""){ | 99 | if(profile != ""){ |
100 | interfaces->copyInterface(interface->getInterfaceName(), newInterfaceName); | ||
103 | if(!interfaces->setMapping(interface->getInterfaceName())){ | 101 | if(!interfaces->setMapping(interface->getInterfaceName())){ |
104 | interfaces->addMapping(interface->getInterfaceName()); | 102 | interfaces->addMapping(interface->getInterfaceName()); |
105 | if(!interfaces->setMapping(interface->getInterfaceName())){ | 103 | if(!interfaces->setMapping(interface->getInterfaceName())){ |
106 | qDebug("InterfaceSetupImp: Added Mapping, but still can't set."); | 104 | qDebug("InterfaceSetupImp: Added Mapping, but still can't set."); |
107 | return; | 105 | return; |
108 | } | 106 | } |
109 | } | 107 | } |
110 | interfaces->setScript("getprofile.sh"); | ||
111 | interfaces->setMap("map", newInterfaceName); | 108 | interfaces->setMap("map", newInterfaceName); |
109 | interfaces->setScript("getprofile.sh"); | ||
110 | } | ||
111 | else{ | ||
112 | interfaces->addInterface(newInterfaceName, INTERFACES_FAMILY_INET, INTERFACES_METHOD_DHCP); | ||
113 | if(!interfaces->setInterface(newInterfaceName)){ | ||
114 | qDebug("InterfaceSetupImp: Added interface, but still can't set."); | ||
115 | return; | ||
116 | } | ||
112 | } | 117 | } |
113 | } | 118 | } |
114 | 119 | ||
115 | // We must have a valid interface to get this far so read some settings. | 120 | // We must have a valid interface to get this far so read some settings. |
116 | 121 | ||
117 | // DHCP | 122 | // DHCP |