summaryrefslogtreecommitdiff
authortille <tille>2003-05-25 00:51:44 (UTC)
committer tille <tille>2003-05-25 00:51:44 (UTC)
commitf6d835c4846f48d33f0ba9e86707c4ec23544182 (patch) (side-by-side diff)
tree65d9019f52445054331ba3a30277ca41abb0feca
parent672a9a2ecd1132aadcf1043946e27339693145a4 (diff)
downloadopie-f6d835c4846f48d33f0ba9e86707c4ec23544182.zip
opie-f6d835c4846f48d33f0ba9e86707c4ec23544182.tar.gz
opie-f6d835c4846f48d33f0ba9e86707c4ec23544182.tar.bz2
ask plugins for interfaces...
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/mainwindowimp.cpp24
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
@@ -156,8 +156,9 @@ void MainWindowImp::getAllInterfaces(){
struct ifreq ifr;
QStringList ifaces;
QFile procFile(QString(_PROCNETDEV));
int result;
+ Interface *i;
if (! procFile.exists()) {
struct ifreq ifrs[100];
struct ifconf ifc;
@@ -186,9 +187,9 @@ void MainWindowImp::getAllInterfaces(){
}
for (QStringList::Iterator it = ifaces.begin(); it != ifaces.end(); ++it) {
int flags = 0, family;
- Interface *i = NULL;
+ i = NULL;
strcpy(ifr.ifr_name, (*it).latin1());
struct ifreq ifcopy;
@@ -215,9 +216,25 @@ void MainWindowImp::getAllInterfaces(){
qWarning("Adding interface %s to interfaceNames\n", ifr.ifr_name);
interfaceNames.insert(i->getInterfaceName(), i);
updateInterface(i);
- connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *)));
+ connect(i, SIGNAL(updateInterface(Interface *)),
+ this, SLOT(updateInterface(Interface *)));
+ }
+ // now lets ask the plugins too ;)
+ QMap<Module*, QLibrary*>::Iterator it;
+ QList<Interface> ilist;
+ for( it = libraries.begin(); it != libraries.end(); ++it ){
+ if(it.key()){
+ ilist = it.key()->getInterfaces();
+ for( i = ilist.first(); i != 0; i = ilist.next() ){
+ qWarning("Adding interface %s to interfaceNames\n", i->getInterfaceName().latin1() );
+ interfaceNames.insert(i->getInterfaceName(), i);
+ updateInterface(i);
+ connect(i, SIGNAL(updateInterface(Interface *)),
+ this, SLOT(updateInterface(Interface *)));
+ }
+ }
}
}
/**
@@ -315,10 +332,9 @@ Module* MainWindowImp::loadPlugin(const QString &pluginFileName, const QString &
void MainWindowImp::addClicked(){
QMap<Module*, QLibrary*>::Iterator it;
QMap<QString, QString> list;
QMap<QString, Module*> newInterfaceOwners;
- //list.insert("USB (PPP) / (ADD_TEST)", "A dialup connection over the USB port");
- //list.insert("IrDa (PPP) / (ADD_TEST)", "A dialup connection over the IdDa port");
+
for( it = libraries.begin(); it != libraries.end(); ++it ){
if(it.key()){
(it.key())->possibleNewInterfaces(list);
}