summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/mainwindowimp.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings/mainwindowimp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/mainwindowimp.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp
index 48ef9b3..7b93554 100644
--- a/noncore/settings/networksettings/mainwindowimp.cpp
+++ b/noncore/settings/networksettings/mainwindowimp.cpp
@@ -21,25 +21,25 @@
21#include <qpe/qpeapplication.h> 21#include <qpe/qpeapplication.h>
22 22
23#include <qlist.h> 23#include <qlist.h>
24#include <qdir.h> 24#include <qdir.h>
25#include <qfile.h> 25#include <qfile.h>
26#include <qtextstream.h> 26#include <qtextstream.h>
27 27
28#include <net/if.h> 28#include <net/if.h>
29#include <sys/ioctl.h> 29#include <sys/ioctl.h>
30 30
31#define DEFAULT_SCHEME "/var/lib/pcmcia/scheme" 31#define DEFAULT_SCHEME "/var/lib/pcmcia/scheme"
32 32
33MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(parent, name, true), advancedUserMode(false){ 33MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(parent, name, true), advancedUserMode(false), scheme(DEFAULT_SCHEME){
34 connect(addConnectionButton, SIGNAL(clicked()), this, SLOT(addClicked())); 34 connect(addConnectionButton, SIGNAL(clicked()), this, SLOT(addClicked()));
35 connect(removeConnectionButton, SIGNAL(clicked()), this, SLOT(removeClicked())); 35 connect(removeConnectionButton, SIGNAL(clicked()), this, SLOT(removeClicked()));
36 connect(informationConnectionButton, SIGNAL(clicked()), this, SLOT(informationClicked())); 36 connect(informationConnectionButton, SIGNAL(clicked()), this, SLOT(informationClicked()));
37 connect(configureConnectionButton, SIGNAL(clicked()), this, SLOT(configureClicked())); 37 connect(configureConnectionButton, SIGNAL(clicked()), this, SLOT(configureClicked()));
38 38
39 connect(newProfileButton, SIGNAL(clicked()), this, SLOT(addProfile())); 39 connect(newProfileButton, SIGNAL(clicked()), this, SLOT(addProfile()));
40 connect(removeProfileButton, SIGNAL(clicked()), this, SLOT(removeProfile())); 40 connect(removeProfileButton, SIGNAL(clicked()), this, SLOT(removeProfile()));
41 connect(setCurrentProfileButton, SIGNAL(clicked()), this, SLOT(changeProfile())); 41 connect(setCurrentProfileButton, SIGNAL(clicked()), this, SLOT(changeProfile()));
42 42
43 connect(newProfile, SIGNAL(textChanged(const QString&)), this, SLOT(newProfileChanged(const QString&))); 43 connect(newProfile, SIGNAL(textChanged(const QString&)), this, SLOT(newProfileChanged(const QString&)));
44 // Load connections. 44 // Load connections.
45 loadModules(QPEApplication::qpeDir() + "/plugins/networksetup"); 45 loadModules(QPEApplication::qpeDir() + "/plugins/networksetup");
@@ -180,50 +180,50 @@ void MainWindowImp::getAllInterfaces(){
180 qDebug(ifr->ifr_name); 180 qDebug(ifr->ifr_name);
181 qDebug(QString("%1").arg(ifr->ifr_addr.sa_family).latin1()); 181 qDebug(QString("%1").arg(ifr->ifr_addr.sa_family).latin1());
182 break; 182 break;
183 } 183 }
184 } 184 }
185} 185}
186 186
187/** 187/**
188 * Load all modules that are found in the path 188 * Load all modules that are found in the path
189 * @param path a directory that is scaned for any plugins that can be loaded 189 * @param path a directory that is scaned for any plugins that can be loaded
190 * and attempts to load them 190 * and attempts to load them
191 */ 191 */
192void MainWindowImp::loadModules(QString path){ 192void MainWindowImp::loadModules(const QString &path){
193 //qDebug(path.latin1()); 193 //qDebug(path.latin1());
194 QDir d(path); 194 QDir d(path);
195 if(!d.exists()) 195 if(!d.exists())
196 return; 196 return;
197 197
198 // Don't want sym links 198 // Don't want sym links
199 d.setFilter( QDir::Files | QDir::NoSymLinks ); 199 d.setFilter( QDir::Files | QDir::NoSymLinks );
200 const QFileInfoList *list = d.entryInfoList(); 200 const QFileInfoList *list = d.entryInfoList();
201 QFileInfoListIterator it( *list ); 201 QFileInfoListIterator it( *list );
202 QFileInfo *fi; 202 QFileInfo *fi;
203 while ( (fi=it.current()) ) { 203 while ( (fi=it.current()) ) {
204 if(fi->fileName().contains(".so")){ 204 if(fi->fileName().contains(".so")){
205 loadPlugin(path + "/" + fi->fileName()); 205 loadPlugin(path + "/" + fi->fileName());
206 } 206 }
207 ++it; 207 ++it;
208 } 208 }
209} 209}
210 210
211/** 211/**
212 * Attempt to load a function and resolve a function. 212 * Attempt to load a function and resolve a function.
213 * @param pluginFileName - the name of the file in which to attempt to load 213 * @param pluginFileName - the name of the file in which to attempt to load
214 * @param resolveString - function pointer to resolve 214 * @param resolveString - function pointer to resolve
215 * @return pointer to the function with name resolveString or NULL 215 * @return pointer to the function with name resolveString or NULL
216 */ 216 */
217Module* MainWindowImp::loadPlugin(QString pluginFileName, QString resolveString){ 217Module* MainWindowImp::loadPlugin(const QString &pluginFileName, const QString &resolveString){
218 //qDebug(QString("MainWindowImp::loadPlugin: %1").arg(pluginFileName).latin1()); 218 //qDebug(QString("MainWindowImp::loadPlugin: %1").arg(pluginFileName).latin1());
219 QLibrary *lib = new QLibrary(pluginFileName); 219 QLibrary *lib = new QLibrary(pluginFileName);
220 void *functionPointer = lib->resolve(resolveString); 220 void *functionPointer = lib->resolve(resolveString);
221 if( !functionPointer ){ 221 if( !functionPointer ){
222 qDebug(QString("MainWindowImp: File: %1 is not a plugin, but though was.").arg(pluginFileName).latin1()); 222 qDebug(QString("MainWindowImp: File: %1 is not a plugin, but though was.").arg(pluginFileName).latin1());
223 delete lib; 223 delete lib;
224 return NULL; 224 return NULL;
225 } 225 }
226 226
227 // Try to get an object. 227 // Try to get an object.
228 Module *object = ((Module* (*)()) functionPointer)(); 228 Module *object = ((Module* (*)()) functionPointer)();
229 if(object == NULL){ 229 if(object == NULL){