-rw-r--r-- | noncore/settings/networksettings/mainwindowimp.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp index a61f620..63b9603 100644 --- a/noncore/settings/networksettings/mainwindowimp.cpp +++ b/noncore/settings/networksettings/mainwindowimp.cpp | |||
@@ -157,6 +157,7 @@ void MainWindowImp::getAllInterfaces(){ | |||
157 | QStringList ifaces; | 157 | QStringList ifaces; |
158 | QFile procFile(QString(_PROCNETDEV)); | 158 | QFile procFile(QString(_PROCNETDEV)); |
159 | int result; | 159 | int result; |
160 | Interface *i; | ||
160 | 161 | ||
161 | if (! procFile.exists()) { | 162 | if (! procFile.exists()) { |
162 | struct ifreq ifrs[100]; | 163 | struct ifreq ifrs[100]; |
@@ -187,7 +188,7 @@ void MainWindowImp::getAllInterfaces(){ | |||
187 | 188 | ||
188 | for (QStringList::Iterator it = ifaces.begin(); it != ifaces.end(); ++it) { | 189 | for (QStringList::Iterator it = ifaces.begin(); it != ifaces.end(); ++it) { |
189 | int flags = 0, family; | 190 | int flags = 0, family; |
190 | Interface *i = NULL; | 191 | i = NULL; |
191 | 192 | ||
192 | strcpy(ifr.ifr_name, (*it).latin1()); | 193 | strcpy(ifr.ifr_name, (*it).latin1()); |
193 | 194 | ||
@@ -216,7 +217,23 @@ void MainWindowImp::getAllInterfaces(){ | |||
216 | qWarning("Adding interface %s to interfaceNames\n", ifr.ifr_name); | 217 | qWarning("Adding interface %s to interfaceNames\n", ifr.ifr_name); |
217 | interfaceNames.insert(i->getInterfaceName(), i); | 218 | interfaceNames.insert(i->getInterfaceName(), i); |
218 | updateInterface(i); | 219 | updateInterface(i); |
219 | connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *))); | 220 | connect(i, SIGNAL(updateInterface(Interface *)), |
221 | this, SLOT(updateInterface(Interface *))); | ||
222 | } | ||
223 | // now lets ask the plugins too ;) | ||
224 | QMap<Module*, QLibrary*>::Iterator it; | ||
225 | QList<Interface> ilist; | ||
226 | for( it = libraries.begin(); it != libraries.end(); ++it ){ | ||
227 | if(it.key()){ | ||
228 | ilist = it.key()->getInterfaces(); | ||
229 | for( i = ilist.first(); i != 0; i = ilist.next() ){ | ||
230 | qWarning("Adding interface %s to interfaceNames\n", i->getInterfaceName().latin1() ); | ||
231 | interfaceNames.insert(i->getInterfaceName(), i); | ||
232 | updateInterface(i); | ||
233 | connect(i, SIGNAL(updateInterface(Interface *)), | ||
234 | this, SLOT(updateInterface(Interface *))); | ||
235 | } | ||
236 | } | ||
220 | } | 237 | } |
221 | } | 238 | } |
222 | 239 | ||
@@ -316,8 +333,7 @@ void MainWindowImp::addClicked(){ | |||
316 | QMap<Module*, QLibrary*>::Iterator it; | 333 | QMap<Module*, QLibrary*>::Iterator it; |
317 | QMap<QString, QString> list; | 334 | QMap<QString, QString> list; |
318 | QMap<QString, Module*> newInterfaceOwners; | 335 | QMap<QString, Module*> newInterfaceOwners; |
319 | //list.insert("USB (PPP) / (ADD_TEST)", "A dialup connection over the USB port"); | 336 | |
320 | //list.insert("IrDa (PPP) / (ADD_TEST)", "A dialup connection over the IdDa port"); | ||
321 | for( it = libraries.begin(); it != libraries.end(); ++it ){ | 337 | for( it = libraries.begin(); it != libraries.end(); ++it ){ |
322 | if(it.key()){ | 338 | if(it.key()){ |
323 | (it.key())->possibleNewInterfaces(list); | 339 | (it.key())->possibleNewInterfaces(list); |