author | benmeyer <benmeyer> | 2002-11-08 16:16:11 (UTC) |
---|---|---|
committer | benmeyer <benmeyer> | 2002-11-08 16:16:11 (UTC) |
commit | e0db2259cc26cab12c6f1131b82dd867c454a3ff (patch) (unidiff) | |
tree | e251396e5e96839aed5bf6a930dff37fefe5acc0 | |
parent | d8ac5b68b504536136347547816992b1cf605cd4 (diff) | |
download | opie-e0db2259cc26cab12c6f1131b82dd867c454a3ff.zip opie-e0db2259cc26cab12c6f1131b82dd867c454a3ff.tar.gz opie-e0db2259cc26cab12c6f1131b82dd867c454a3ff.tar.bz2 |
Code Optimizations
36 files changed, 238 insertions, 192 deletions
diff --git a/noncore/net/networksetup/TODO b/noncore/net/networksetup/TODO index 8e57405..7185dbe 100644 --- a/noncore/net/networksetup/TODO +++ b/noncore/net/networksetup/TODO | |||
@@ -2,4 +2,2 @@ CLEAN UP | |||
2 | 2 | ||
3 | Write a class that parses /proc and not ifconfig | ||
4 | |||
5 | udchcp needs to output the dhcp information so interfaces can read it | 3 | udchcp needs to output the dhcp information so interfaces can read it |
@@ -14 +12,2 @@ WLAN - add possiblity to input text or hex without knowing "s:" | |||
14 | 12 | ||
13 | Interface setupimp needs to use kernel calls. | ||
diff --git a/noncore/net/networksetup/addconnectionimp.cpp b/noncore/net/networksetup/addconnectionimp.cpp index 53db0fc..07545f7 100644 --- a/noncore/net/networksetup/addconnectionimp.cpp +++ b/noncore/net/networksetup/addconnectionimp.cpp | |||
@@ -19,5 +19,4 @@ void AddConnectionImp::changed(){ | |||
19 | QListViewItem *item = registeredServicesList->currentItem(); | 19 | QListViewItem *item = registeredServicesList->currentItem(); |
20 | if(item){ | 20 | if(item) |
21 | help->setText(list[item->text(0)]); | 21 | help->setText(list[item->text(0)]); |
22 | } | ||
23 | } | 22 | } |
@@ -28,3 +27,3 @@ void AddConnectionImp::changed(){ | |||
28 | */ | 27 | */ |
29 | void AddConnectionImp::addConnections(QMap<QString, QString> newList){ | 28 | void AddConnectionImp::addConnections(const QMap<QString, QString> &newList){ |
30 | list = newList; | 29 | list = newList; |
diff --git a/noncore/net/networksetup/addconnectionimp.h b/noncore/net/networksetup/addconnectionimp.h index 643cd9a..680a502 100644 --- a/noncore/net/networksetup/addconnectionimp.h +++ b/noncore/net/networksetup/addconnectionimp.h | |||
@@ -15,3 +15,3 @@ public: | |||
15 | AddConnectionImp(QWidget *parent=0, const char *name=0, WFlags f=0); | 15 | AddConnectionImp(QWidget *parent=0, const char *name=0, WFlags f=0); |
16 | void addConnections(QMap<QString, QString> newList); | 16 | void addConnections(const QMap<QString, QString> &newList); |
17 | 17 | ||
diff --git a/noncore/net/networksetup/interfaces/interface.cpp b/noncore/net/networksetup/interfaces/interface.cpp index e4f405e..4129b3d 100644 --- a/noncore/net/networksetup/interfaces/interface.cpp +++ b/noncore/net/networksetup/interfaces/interface.cpp | |||
@@ -44,3 +44,3 @@ void Interface::setAttached(bool isAttached){ | |||
44 | */ | 44 | */ |
45 | void Interface::setHardwareName(QString name){ | 45 | void Interface::setHardwareName(const QString &name){ |
46 | hardwareName = name; | 46 | hardwareName = name; |
diff --git a/noncore/net/networksetup/interfaces/interface.h b/noncore/net/networksetup/interfaces/interface.h index fc064fe..989d6d8 100644 --- a/noncore/net/networksetup/interfaces/interface.h +++ b/noncore/net/networksetup/interfaces/interface.h | |||
@@ -17,17 +17,16 @@ public: | |||
17 | Interface(QObject * parent=0, const char * name= "unknown", bool status = false); | 17 | Interface(QObject * parent=0, const char * name= "unknown", bool status = false); |
18 | virtual ~Interface(){}; | ||
19 | 18 | ||
20 | virtual QString getInterfaceName(){ QString n(this->name()); return n; }; | 19 | QString getInterfaceName(){ QString n(this->name()); return n; }; |
21 | 20 | ||
22 | virtual bool getStatus(){ return status; }; | 21 | bool getStatus(){ return status; }; |
23 | virtual void setStatus(bool newStatus); | 22 | void setStatus(bool newStatus); |
24 | 23 | ||
25 | virtual bool isAttached(){ return attached; }; | 24 | bool isAttached(){ return attached; }; |
26 | virtual void setAttached(bool isAttached=false); | 25 | void setAttached(bool isAttached=false); |
27 | 26 | ||
28 | virtual QString getHardwareName(){ return hardwareName; }; | 27 | QString getHardwareName(){ return hardwareName; }; |
29 | virtual void setHardwareName(QString name="Unknown"); | 28 | void setHardwareName(const QString &name="Unknown"); |
30 | 29 | ||
31 | virtual Module* getModuleOwner(){ return moduleOwner; }; | 30 | Module* getModuleOwner(){ return moduleOwner; }; |
32 | virtual void setModuleOwner(Module *owner=NULL); | 31 | void setModuleOwner(Module *owner=NULL); |
33 | 32 | ||
diff --git a/noncore/net/networksetup/interfaces/interfaces.cpp b/noncore/net/networksetup/interfaces/interfaces.cpp index f1b8067..708f399 100644 --- a/noncore/net/networksetup/interfaces/interfaces.cpp +++ b/noncore/net/networksetup/interfaces/interfaces.cpp | |||
@@ -72,3 +72,3 @@ QStringList Interfaces::getInterfaceList(){ | |||
72 | */ | 72 | */ |
73 | bool Interfaces::isAuto(QString interface){ | 73 | bool Interfaces::isAuto(const QString &interface){ |
74 | QStringList autoLines = interfaces.grep(QRegExp(AUTO)); | 74 | QStringList autoLines = interfaces.grep(QRegExp(AUTO)); |
@@ -88,3 +88,3 @@ bool Interfaces::isAuto(QString interface){ | |||
88 | * */ | 88 | * */ |
89 | bool Interfaces::setAuto(QString interface, bool setAuto){ | 89 | bool Interfaces::setAuto(const QString &interface, bool setAuto){ |
90 | // Don't need to set it if it is already set. | 90 | // Don't need to set it if it is already set. |
@@ -158,9 +158,9 @@ bool Interfaces::isInterfaceSet(){ | |||
158 | */ | 158 | */ |
159 | bool Interfaces::addInterface(QString interface, QString family, QString method){ | 159 | bool Interfaces::addInterface(const QString &interface, const QString &family, const QString &method){ |
160 | if(acceptedFamily.contains(family)==0) | 160 | if(acceptedFamily.contains(family)==0) |
161 | return false; | 161 | return false; |
162 | interface = interface.simplifyWhiteSpace(); | 162 | QString newInterface = interface.simplifyWhiteSpace(); |
163 | interface = interface.replace(QRegExp(" "), ""); | 163 | newInterface = newInterface.replace(QRegExp(" "), ""); |
164 | interfaces.append(""); | 164 | interfaces.append(""); |
165 | interfaces.append(QString(IFACE " %1 %2 %3").arg(interface).arg(family).arg(method)); | 165 | interfaces.append(QString(IFACE " %1 %2 %3").arg(newInterface).arg(family).arg(method)); |
166 | return true; | 166 | return true; |
@@ -173,3 +173,3 @@ bool Interfaces::addInterface(QString interface, QString family, QString method) | |||
173 | */ | 173 | */ |
174 | bool Interfaces::copyInterface(QString interface, QString newInterface){ | 174 | bool Interfaces::copyInterface(const QString &interface, const QString &newInterface){ |
175 | if(!setInterface(interface)) return false; | 175 | if(!setInterface(interface)) return false; |
@@ -282,9 +282,9 @@ QString Interfaces::getInterfaceMethod(bool &error){ | |||
282 | */ | 282 | */ |
283 | bool Interfaces::setInterfaceName(QString newName){ | 283 | bool Interfaces::setInterfaceName(const QString &newName){ |
284 | if(currentIface == interfaces.end()) | 284 | if(currentIface == interfaces.end()) |
285 | return false; | 285 | return false; |
286 | newName = newName.simplifyWhiteSpace(); | 286 | QString name = newName.simplifyWhiteSpace(); |
287 | newName = newName.replace(QRegExp(" "), ""); | 287 | name = name.replace(QRegExp(" "), ""); |
288 | bool returnValue = false; | 288 | bool returnValue = false; |
289 | (*currentIface) = QString("iface %1 %2 %3").arg(newName).arg(getInterfaceFamily(returnValue)).arg(getInterfaceMethod(returnValue)); | 289 | (*currentIface) = QString("iface %1 %2 %3").arg(name).arg(getInterfaceFamily(returnValue)).arg(getInterfaceMethod(returnValue)); |
290 | return !returnValue; | 290 | return !returnValue; |
@@ -298,3 +298,3 @@ bool Interfaces::setInterfaceName(QString newName){ | |||
298 | */ | 298 | */ |
299 | bool Interfaces::setInterfaceFamily(QString newName){ | 299 | bool Interfaces::setInterfaceFamily(const QString &newName){ |
300 | if(currentIface == interfaces.end()) | 300 | if(currentIface == interfaces.end()) |
@@ -313,3 +313,3 @@ bool Interfaces::setInterfaceFamily(QString newName){ | |||
313 | */ | 313 | */ |
314 | bool Interfaces::setInterfaceMethod(QString newName){ | 314 | bool Interfaces::setInterfaceMethod(const QString &newName){ |
315 | if(currentIface == interfaces.end()) | 315 | if(currentIface == interfaces.end()) |
@@ -331,3 +331,3 @@ bool Interfaces::setInterfaceMethod(QString newName){ | |||
331 | */ | 331 | */ |
332 | QString Interfaces::getInterfaceOption(QString option, bool &error){ | 332 | QString Interfaces::getInterfaceOption(const QString &option, bool &error){ |
333 | return getOption(currentIface, option, error); | 333 | return getOption(currentIface, option, error); |
@@ -343,3 +343,3 @@ QString Interfaces::getInterfaceOption(QString option, bool &error){ | |||
343 | */ | 343 | */ |
344 | bool Interfaces::setInterfaceOption(QString option, QString value){ | 344 | bool Interfaces::setInterfaceOption(const QString &option, const QString &value){ |
345 | return setOption(currentIface, option, value); | 345 | return setOption(currentIface, option, value); |
@@ -354,3 +354,3 @@ bool Interfaces::setInterfaceOption(QString option, QString value){ | |||
354 | */ | 354 | */ |
355 | bool Interfaces::removeInterfaceOption(QString option, QString value){ | 355 | bool Interfaces::removeInterfaceOption(const QString &option, const QString &value){ |
356 | return removeOption(currentIface, option, value); | 356 | return removeOption(currentIface, option, value); |
@@ -373,6 +373,6 @@ bool Interfaces::removeAllInterfaceOptions(){ | |||
373 | */ | 373 | */ |
374 | bool Interfaces::setMapping(QString interface){ | 374 | bool Interfaces::setMapping(const QString &interface){ |
375 | interface = interface.simplifyWhiteSpace(); | 375 | QString interfaceName = interface.simplifyWhiteSpace(); |
376 | interface = interface.replace(QRegExp(" "), ""); | 376 | interfaceName = interfaceName.replace(QRegExp(" "), ""); |
377 | return setStanza(MAPPING, interface, currentMapping); | 377 | return setStanza(MAPPING, interfaceName, currentMapping); |
378 | } | 378 | } |
@@ -383,3 +383,3 @@ bool Interfaces::setMapping(QString interface){ | |||
383 | */ | 383 | */ |
384 | void Interfaces::addMapping(QString option){ | 384 | void Interfaces::addMapping(const QString &option){ |
385 | interfaces.append(""); | 385 | interfaces.append(""); |
@@ -405,3 +405,3 @@ bool Interfaces::removeMapping(){ | |||
405 | */ | 405 | */ |
406 | bool Interfaces::setMap(QString map, QString value){ | 406 | bool Interfaces::setMap(const QString &map, const QString &value){ |
407 | return setOption(currentMapping, map, value); | 407 | return setOption(currentMapping, map, value); |
@@ -415,3 +415,3 @@ bool Interfaces::setMap(QString map, QString value){ | |||
415 | */ | 415 | */ |
416 | bool Interfaces::removeMap(QString map, QString value){ | 416 | bool Interfaces::removeMap(const QString &map, const QString &value){ |
417 | return removeOption(currentMapping, map, value); | 417 | return removeOption(currentMapping, map, value); |
@@ -425,3 +425,3 @@ bool Interfaces::removeMap(QString map, QString value){ | |||
425 | */ | 425 | */ |
426 | QString Interfaces::getMap(QString map, bool &error){ | 426 | QString Interfaces::getMap(const QString &map, bool &error){ |
427 | return getOption(currentMapping, map, error); | 427 | return getOption(currentMapping, map, error); |
@@ -434,3 +434,3 @@ QString Interfaces::getMap(QString map, bool &error){ | |||
434 | */ | 434 | */ |
435 | bool Interfaces::setScript(QString argument){ | 435 | bool Interfaces::setScript(const QString &argument){ |
436 | return setOption(currentMapping, "script", argument); | 436 | return setOption(currentMapping, "script", argument); |
@@ -446,2 +446,4 @@ QString Interfaces::getScript(bool &error){ | |||
446 | 446 | ||
447 | |||
448 | |||
447 | /** | 449 | /** |
@@ -454,3 +456,3 @@ QString Interfaces::getScript(bool &error){ | |||
454 | */ | 456 | */ |
455 | bool Interfaces::setStanza(QString stanza, QString option, QStringList::Iterator &iterator){ | 457 | bool Interfaces::setStanza(const QString &stanza, const QString &option, QStringList::Iterator &iterator){ |
456 | bool found = false; | 458 | bool found = false; |
@@ -491,3 +493,3 @@ bool Interfaces::setStanza(QString stanza, QString option, QStringList::Iterator | |||
491 | */ | 493 | */ |
492 | bool Interfaces::setOption(QStringList::Iterator start, QString option, QString value){ | 494 | bool Interfaces::setOption(const QStringList::Iterator &start, const QString &option, const QString &value){ |
493 | if(start == interfaces.end()) | 495 | if(start == interfaces.end()) |
@@ -526,3 +528,3 @@ bool Interfaces::setOption(QStringList::Iterator start, QString option, QString | |||
526 | */ | 528 | */ |
527 | bool Interfaces::removeOption(QStringList::Iterator start, QString option, QString value){ | 529 | bool Interfaces::removeOption(const QStringList::Iterator &start, const QString &option, const QString &value){ |
528 | if(start == interfaces.end()) | 530 | if(start == interfaces.end()) |
@@ -552,3 +554,3 @@ bool Interfaces::removeOption(QStringList::Iterator start, QString option, QStri | |||
552 | */ | 554 | */ |
553 | bool Interfaces::removeAllOptions(QStringList::Iterator start){ | 555 | bool Interfaces::removeAllOptions(const QStringList::Iterator &start){ |
554 | if(start == interfaces.end()) | 556 | if(start == interfaces.end()) |
@@ -577,3 +579,3 @@ bool Interfaces::removeAllOptions(QStringList::Iterator start){ | |||
577 | */ | 579 | */ |
578 | QString Interfaces::getOption(QStringList::Iterator start, QString option, bool &error){ | 580 | QString Interfaces::getOption(const QStringList::Iterator &start, const QString &option, bool &error){ |
579 | if(start == interfaces.end()){ | 581 | if(start == interfaces.end()){ |
diff --git a/noncore/net/networksetup/interfaces/interfaces.h b/noncore/net/networksetup/interfaces/interfaces.h index e09ea71..26abb73 100644 --- a/noncore/net/networksetup/interfaces/interfaces.h +++ b/noncore/net/networksetup/interfaces/interfaces.h | |||
@@ -27,29 +27,29 @@ public: | |||
27 | 27 | ||
28 | bool isAuto(QString interface); | 28 | bool isAuto(const QString &interface); |
29 | bool setAuto(QString interface, bool setAuto); | 29 | bool setAuto(const QString &interface, bool setAuto); |
30 | 30 | ||
31 | bool removeInterface(); | 31 | bool removeInterface(); |
32 | bool addInterface(QString interface, QString family, QString method); | 32 | bool addInterface(const QString &interface, const QString &family, const QString &method); |
33 | bool copyInterface(QString oldInterface, QString newInterface); | 33 | bool copyInterface(const QString &oldInterface, const QString &newInterface); |
34 | bool setInterface(QString interface); | 34 | bool setInterface(QString interface); |
35 | bool isInterfaceSet(); | 35 | inline bool isInterfaceSet(); |
36 | QString getInterfaceName(bool &error); | 36 | QString getInterfaceName(bool &error); |
37 | bool setInterfaceName(QString newName); | 37 | bool setInterfaceName(const QString &newName); |
38 | QString getInterfaceFamily(bool &error); | 38 | QString getInterfaceFamily(bool &error); |
39 | bool setInterfaceFamily(QString newName); | 39 | bool setInterfaceFamily(const QString &newName); |
40 | QString getInterfaceMethod(bool &error); | 40 | QString getInterfaceMethod(bool &error); |
41 | bool setInterfaceMethod(QString newName); | 41 | bool setInterfaceMethod(const QString &newName); |
42 | QString getInterfaceOption(QString option, bool &error); | 42 | inline QString getInterfaceOption(const QString &option, bool &error); |
43 | bool setInterfaceOption(QString option, QString value); | 43 | inline bool setInterfaceOption(const QString &option, const QString &value); |
44 | bool removeInterfaceOption(QString option, QString value); | 44 | inline bool removeInterfaceOption(const QString &option, const QString &value); |
45 | bool removeAllInterfaceOptions(); | 45 | inline bool removeAllInterfaceOptions(); |
46 | 46 | ||
47 | bool setMapping(QString interface); | 47 | bool setMapping(const QString &interface); |
48 | bool removeMapping(); | 48 | bool removeMapping(); |
49 | void addMapping(QString options); | 49 | inline void addMapping(const QString &options); |
50 | bool setMap(QString map, QString value); | 50 | inline bool setMap(const QString &map, const QString &value); |
51 | bool removeMap(QString map, QString value); | 51 | inline bool removeMap(const QString &map, const QString &value); |
52 | QString getMap(QString map, bool &error); | 52 | inline QString getMap(const QString &map, bool &error); |
53 | bool setScript(QString); | 53 | inline bool setScript(const QString &argument); |
54 | QString getScript(bool &error); | 54 | inline QString getScript(bool &error); |
55 | 55 | ||
@@ -58,7 +58,7 @@ public: | |||
58 | private: | 58 | private: |
59 | bool setStanza(QString stanza, QString option,QStringList::Iterator &iterator); | 59 | bool setStanza(const QString &stanza, const QString &option, QStringList::Iterator &iterator); |
60 | bool setOption(QStringList::Iterator start, QString option, QString value); | 60 | bool setOption(const QStringList::Iterator &start, const QString &option, const QString &value); |
61 | bool removeOption(QStringList::Iterator start, QString option, QString value); | 61 | bool removeOption(const QStringList::Iterator &start, const QString &option, const QString &value); |
62 | QString getOption(QStringList::Iterator start, QString option, bool &error); | 62 | QString getOption(const QStringList::Iterator &start, const QString &option, bool &error); |
63 | bool removeAllOptions(QStringList::Iterator start); | 63 | bool removeAllOptions(const QStringList::Iterator &start); |
64 | 64 | ||
diff --git a/noncore/net/networksetup/interfaces/interfacesetup.ui b/noncore/net/networksetup/interfaces/interfacesetup.ui index ab8e413..df55d25 100644 --- a/noncore/net/networksetup/interfaces/interfacesetup.ui +++ b/noncore/net/networksetup/interfaces/interfacesetup.ui | |||
@@ -101,2 +101,6 @@ | |||
101 | <property stdset="1"> | 101 | <property stdset="1"> |
102 | <name>lineStep</name> | ||
103 | <number>24</number> | ||
104 | </property> | ||
105 | <property stdset="1"> | ||
102 | <name>value</name> | 106 | <name>value</name> |
@@ -253,2 +257,24 @@ | |||
253 | </widget> | 257 | </widget> |
258 | <customwidgets> | ||
259 | <customwidget> | ||
260 | <class>QWidget</class> | ||
261 | <header location="local">qwidget.h</header> | ||
262 | <sizehint> | ||
263 | <width>100</width> | ||
264 | <height>100</height> | ||
265 | </sizehint> | ||
266 | <container>0</container> | ||
267 | <sizepolicy> | ||
268 | <hordata>7</hordata> | ||
269 | <verdata>7</verdata> | ||
270 | </sizepolicy> | ||
271 | <pixmap>image0</pixmap> | ||
272 | </customwidget> | ||
273 | </customwidgets> | ||
274 | <images> | ||
275 | <image> | ||
276 | <name>image0</name> | ||
277 | <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> | ||
278 | </image> | ||
279 | </images> | ||
254 | <connections> | 280 | <connections> |
diff --git a/noncore/net/networksetup/interfaces/interfacesetupimp.h b/noncore/net/networksetup/interfaces/interfacesetupimp.h index a88e190..60933aa 100644 --- a/noncore/net/networksetup/interfaces/interfacesetupimp.h +++ b/noncore/net/networksetup/interfaces/interfacesetupimp.h | |||
@@ -23,3 +23,2 @@ private: | |||
23 | Interface *interface; | 23 | Interface *interface; |
24 | |||
25 | }; | 24 | }; |
diff --git a/noncore/net/networksetup/mainwindowimp.cpp b/noncore/net/networksetup/mainwindowimp.cpp index 48ef9b3..7b93554 100644 --- a/noncore/net/networksetup/mainwindowimp.cpp +++ b/noncore/net/networksetup/mainwindowimp.cpp | |||
@@ -32,3 +32,3 @@ | |||
32 | 32 | ||
33 | MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(parent, name, true), advancedUserMode(false){ | 33 | MainWindowImp::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())); |
@@ -191,3 +191,3 @@ void MainWindowImp::getAllInterfaces(){ | |||
191 | */ | 191 | */ |
192 | void MainWindowImp::loadModules(QString path){ | 192 | void MainWindowImp::loadModules(const QString &path){ |
193 | //qDebug(path.latin1()); | 193 | //qDebug(path.latin1()); |
@@ -216,3 +216,3 @@ void MainWindowImp::loadModules(QString path){ | |||
216 | */ | 216 | */ |
217 | Module* MainWindowImp::loadPlugin(QString pluginFileName, QString resolveString){ | 217 | Module* 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()); |
diff --git a/noncore/net/networksetup/mainwindowimp.h b/noncore/net/networksetup/mainwindowimp.h index 382428c..4f09d6c 100644 --- a/noncore/net/networksetup/mainwindowimp.h +++ b/noncore/net/networksetup/mainwindowimp.h | |||
@@ -35,6 +35,6 @@ private slots: | |||
35 | private: | 35 | private: |
36 | void loadModules(QString path); | 36 | void loadModules(const QString &path); |
37 | 37 | ||
38 | Module* loadPlugin(QString pluginFileName, | 38 | Module* loadPlugin(const QString &pluginFileName, |
39 | QString resolveString = "create_plugin"); | 39 | const QString &resolveString = "create_plugin"); |
40 | 40 | ||
diff --git a/noncore/net/networksetup/module.h b/noncore/net/networksetup/module.h index 92b125a..2e6272b 100644 --- a/noncore/net/networksetup/module.h +++ b/noncore/net/networksetup/module.h | |||
@@ -24,3 +24,3 @@ public: | |||
24 | */ | 24 | */ |
25 | virtual void setProfile(QString newProfile) = 0; | 25 | virtual void setProfile(const QString &newProfile) = 0; |
26 | 26 | ||
@@ -72,3 +72,3 @@ public: | |||
72 | */ | 72 | */ |
73 | virtual Interface *addNewInterface(QString name) = 0; | 73 | virtual Interface *addNewInterface(const QString &name) = 0; |
74 | 74 | ||
diff --git a/noncore/net/networksetup/wlan/infoimp.h b/noncore/net/networksetup/wlan/infoimp.h index 5311bea..8f7f0d6 100644 --- a/noncore/net/networksetup/wlan/infoimp.h +++ b/noncore/net/networksetup/wlan/infoimp.h | |||
@@ -6,3 +6,3 @@ | |||
6 | class QTimer; | 6 | class QTimer; |
7 | class WExtensions; | 7 | //class WExtensions; |
8 | 8 | ||
diff --git a/noncore/net/networksetup/wlan/wextensions.cpp b/noncore/net/networksetup/wlan/wextensions.cpp index eb6fc42..6335ebc 100644 --- a/noncore/net/networksetup/wlan/wextensions.cpp +++ b/noncore/net/networksetup/wlan/wextensions.cpp | |||
@@ -18,4 +18,3 @@ | |||
18 | */ | 18 | */ |
19 | WExtensions::WExtensions(QString interfaceName): hasWirelessExtensions(false){ | 19 | WExtensions::WExtensions(QString interfaceName): hasWirelessExtensions(false), interface(interfaceName) { |
20 | interface = interfaceName; | ||
21 | fd = socket( AF_INET, SOCK_DGRAM, 0 ); | 20 | fd = socket( AF_INET, SOCK_DGRAM, 0 ); |
diff --git a/noncore/net/networksetup/wlan/wlanimp.cpp b/noncore/net/networksetup/wlan/wlanimp.cpp index 689eae2..d4b4af9 100644 --- a/noncore/net/networksetup/wlan/wlanimp.cpp +++ b/noncore/net/networksetup/wlan/wlanimp.cpp | |||
@@ -46,3 +46,3 @@ WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, W | |||
46 | */ | 46 | */ |
47 | void WLANImp::setProfile(QString &profile){ | 47 | void WLANImp::setProfile(const QString &profile){ |
48 | interfaceSetup->setProfile(profile); | 48 | interfaceSetup->setProfile(profile); |
diff --git a/noncore/net/networksetup/wlan/wlanimp.h b/noncore/net/networksetup/wlan/wlanimp.h index f88e550..df599af 100644 --- a/noncore/net/networksetup/wlan/wlanimp.h +++ b/noncore/net/networksetup/wlan/wlanimp.h | |||
@@ -15,3 +15,3 @@ public: | |||
15 | WLANImp( QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = FALSE, WFlags fl = 0 ); | 15 | WLANImp( QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = FALSE, WFlags fl = 0 ); |
16 | void setProfile(QString &profile); | 16 | void setProfile(const QString &profile); |
17 | 17 | ||
diff --git a/noncore/net/networksetup/wlan/wlanmodule.cpp b/noncore/net/networksetup/wlan/wlanmodule.cpp index b14fc0a..3979e60 100644 --- a/noncore/net/networksetup/wlan/wlanmodule.cpp +++ b/noncore/net/networksetup/wlan/wlanmodule.cpp | |||
@@ -28,3 +28,3 @@ WLANModule::~WLANModule(){ | |||
28 | */ | 28 | */ |
29 | void WLANModule::setProfile(QString newProfile){ | 29 | void WLANModule::setProfile(const QString &newProfile){ |
30 | profile = newProfile; | 30 | profile = newProfile; |
@@ -96,3 +96,3 @@ QList<Interface> WLANModule::getInterfaces(){ | |||
96 | */ | 96 | */ |
97 | Interface *WLANModule::addNewInterface(QString ){ | 97 | Interface *WLANModule::addNewInterface(const QString &){ |
98 | // We can't add a 802.11 interface, either the hardware will be there | 98 | // We can't add a 802.11 interface, either the hardware will be there |
diff --git a/noncore/net/networksetup/wlan/wlanmodule.h b/noncore/net/networksetup/wlan/wlanmodule.h index a81ccff..3a54de6 100644 --- a/noncore/net/networksetup/wlan/wlanmodule.h +++ b/noncore/net/networksetup/wlan/wlanmodule.h | |||
@@ -14,11 +14,11 @@ public: | |||
14 | 14 | ||
15 | virtual void setProfile(QString newProfile); | 15 | void setProfile(const QString &newProfile); |
16 | virtual bool isOwner(Interface *); | 16 | bool isOwner(Interface *); |
17 | virtual QWidget *configure(Interface *i); | 17 | QWidget *configure(Interface *i); |
18 | virtual QWidget *information(Interface *i); | 18 | QWidget *information(Interface *i); |
19 | virtual QList<Interface> getInterfaces(); | 19 | QList<Interface> getInterfaces(); |
20 | virtual void possibleNewInterfaces(QMap<QString, QString> &){}; | 20 | void possibleNewInterfaces(QMap<QString, QString> &){}; |
21 | virtual Interface *addNewInterface(QString name); | 21 | Interface *addNewInterface(const QString &name); |
22 | virtual bool remove(Interface* i); | 22 | bool remove(Interface* i); |
23 | virtual QString getPixmapName(Interface* i); | 23 | QString getPixmapName(Interface* i); |
24 | 24 | ||
diff --git a/noncore/settings/networksettings/TODO b/noncore/settings/networksettings/TODO index 8e57405..7185dbe 100644 --- a/noncore/settings/networksettings/TODO +++ b/noncore/settings/networksettings/TODO | |||
@@ -2,4 +2,2 @@ CLEAN UP | |||
2 | 2 | ||
3 | Write a class that parses /proc and not ifconfig | ||
4 | |||
5 | udchcp needs to output the dhcp information so interfaces can read it | 3 | udchcp needs to output the dhcp information so interfaces can read it |
@@ -14 +12,2 @@ WLAN - add possiblity to input text or hex without knowing "s:" | |||
14 | 12 | ||
13 | Interface setupimp needs to use kernel calls. | ||
diff --git a/noncore/settings/networksettings/addconnectionimp.cpp b/noncore/settings/networksettings/addconnectionimp.cpp index 53db0fc..07545f7 100644 --- a/noncore/settings/networksettings/addconnectionimp.cpp +++ b/noncore/settings/networksettings/addconnectionimp.cpp | |||
@@ -19,5 +19,4 @@ void AddConnectionImp::changed(){ | |||
19 | QListViewItem *item = registeredServicesList->currentItem(); | 19 | QListViewItem *item = registeredServicesList->currentItem(); |
20 | if(item){ | 20 | if(item) |
21 | help->setText(list[item->text(0)]); | 21 | help->setText(list[item->text(0)]); |
22 | } | ||
23 | } | 22 | } |
@@ -28,3 +27,3 @@ void AddConnectionImp::changed(){ | |||
28 | */ | 27 | */ |
29 | void AddConnectionImp::addConnections(QMap<QString, QString> newList){ | 28 | void AddConnectionImp::addConnections(const QMap<QString, QString> &newList){ |
30 | list = newList; | 29 | list = newList; |
diff --git a/noncore/settings/networksettings/addconnectionimp.h b/noncore/settings/networksettings/addconnectionimp.h index 643cd9a..680a502 100644 --- a/noncore/settings/networksettings/addconnectionimp.h +++ b/noncore/settings/networksettings/addconnectionimp.h | |||
@@ -15,3 +15,3 @@ public: | |||
15 | AddConnectionImp(QWidget *parent=0, const char *name=0, WFlags f=0); | 15 | AddConnectionImp(QWidget *parent=0, const char *name=0, WFlags f=0); |
16 | void addConnections(QMap<QString, QString> newList); | 16 | void addConnections(const QMap<QString, QString> &newList); |
17 | 17 | ||
diff --git a/noncore/settings/networksettings/interfaces/interface.cpp b/noncore/settings/networksettings/interfaces/interface.cpp index e4f405e..4129b3d 100644 --- a/noncore/settings/networksettings/interfaces/interface.cpp +++ b/noncore/settings/networksettings/interfaces/interface.cpp | |||
@@ -44,3 +44,3 @@ void Interface::setAttached(bool isAttached){ | |||
44 | */ | 44 | */ |
45 | void Interface::setHardwareName(QString name){ | 45 | void Interface::setHardwareName(const QString &name){ |
46 | hardwareName = name; | 46 | hardwareName = name; |
diff --git a/noncore/settings/networksettings/interfaces/interface.h b/noncore/settings/networksettings/interfaces/interface.h index fc064fe..989d6d8 100644 --- a/noncore/settings/networksettings/interfaces/interface.h +++ b/noncore/settings/networksettings/interfaces/interface.h | |||
@@ -17,17 +17,16 @@ public: | |||
17 | Interface(QObject * parent=0, const char * name= "unknown", bool status = false); | 17 | Interface(QObject * parent=0, const char * name= "unknown", bool status = false); |
18 | virtual ~Interface(){}; | ||
19 | 18 | ||
20 | virtual QString getInterfaceName(){ QString n(this->name()); return n; }; | 19 | QString getInterfaceName(){ QString n(this->name()); return n; }; |
21 | 20 | ||
22 | virtual bool getStatus(){ return status; }; | 21 | bool getStatus(){ return status; }; |
23 | virtual void setStatus(bool newStatus); | 22 | void setStatus(bool newStatus); |
24 | 23 | ||
25 | virtual bool isAttached(){ return attached; }; | 24 | bool isAttached(){ return attached; }; |
26 | virtual void setAttached(bool isAttached=false); | 25 | void setAttached(bool isAttached=false); |
27 | 26 | ||
28 | virtual QString getHardwareName(){ return hardwareName; }; | 27 | QString getHardwareName(){ return hardwareName; }; |
29 | virtual void setHardwareName(QString name="Unknown"); | 28 | void setHardwareName(const QString &name="Unknown"); |
30 | 29 | ||
31 | virtual Module* getModuleOwner(){ return moduleOwner; }; | 30 | Module* getModuleOwner(){ return moduleOwner; }; |
32 | virtual void setModuleOwner(Module *owner=NULL); | 31 | void setModuleOwner(Module *owner=NULL); |
33 | 32 | ||
diff --git a/noncore/settings/networksettings/interfaces/interfaces.cpp b/noncore/settings/networksettings/interfaces/interfaces.cpp index f1b8067..708f399 100644 --- a/noncore/settings/networksettings/interfaces/interfaces.cpp +++ b/noncore/settings/networksettings/interfaces/interfaces.cpp | |||
@@ -72,3 +72,3 @@ QStringList Interfaces::getInterfaceList(){ | |||
72 | */ | 72 | */ |
73 | bool Interfaces::isAuto(QString interface){ | 73 | bool Interfaces::isAuto(const QString &interface){ |
74 | QStringList autoLines = interfaces.grep(QRegExp(AUTO)); | 74 | QStringList autoLines = interfaces.grep(QRegExp(AUTO)); |
@@ -88,3 +88,3 @@ bool Interfaces::isAuto(QString interface){ | |||
88 | * */ | 88 | * */ |
89 | bool Interfaces::setAuto(QString interface, bool setAuto){ | 89 | bool Interfaces::setAuto(const QString &interface, bool setAuto){ |
90 | // Don't need to set it if it is already set. | 90 | // Don't need to set it if it is already set. |
@@ -158,9 +158,9 @@ bool Interfaces::isInterfaceSet(){ | |||
158 | */ | 158 | */ |
159 | bool Interfaces::addInterface(QString interface, QString family, QString method){ | 159 | bool Interfaces::addInterface(const QString &interface, const QString &family, const QString &method){ |
160 | if(acceptedFamily.contains(family)==0) | 160 | if(acceptedFamily.contains(family)==0) |
161 | return false; | 161 | return false; |
162 | interface = interface.simplifyWhiteSpace(); | 162 | QString newInterface = interface.simplifyWhiteSpace(); |
163 | interface = interface.replace(QRegExp(" "), ""); | 163 | newInterface = newInterface.replace(QRegExp(" "), ""); |
164 | interfaces.append(""); | 164 | interfaces.append(""); |
165 | interfaces.append(QString(IFACE " %1 %2 %3").arg(interface).arg(family).arg(method)); | 165 | interfaces.append(QString(IFACE " %1 %2 %3").arg(newInterface).arg(family).arg(method)); |
166 | return true; | 166 | return true; |
@@ -173,3 +173,3 @@ bool Interfaces::addInterface(QString interface, QString family, QString method) | |||
173 | */ | 173 | */ |
174 | bool Interfaces::copyInterface(QString interface, QString newInterface){ | 174 | bool Interfaces::copyInterface(const QString &interface, const QString &newInterface){ |
175 | if(!setInterface(interface)) return false; | 175 | if(!setInterface(interface)) return false; |
@@ -282,9 +282,9 @@ QString Interfaces::getInterfaceMethod(bool &error){ | |||
282 | */ | 282 | */ |
283 | bool Interfaces::setInterfaceName(QString newName){ | 283 | bool Interfaces::setInterfaceName(const QString &newName){ |
284 | if(currentIface == interfaces.end()) | 284 | if(currentIface == interfaces.end()) |
285 | return false; | 285 | return false; |
286 | newName = newName.simplifyWhiteSpace(); | 286 | QString name = newName.simplifyWhiteSpace(); |
287 | newName = newName.replace(QRegExp(" "), ""); | 287 | name = name.replace(QRegExp(" "), ""); |
288 | bool returnValue = false; | 288 | bool returnValue = false; |
289 | (*currentIface) = QString("iface %1 %2 %3").arg(newName).arg(getInterfaceFamily(returnValue)).arg(getInterfaceMethod(returnValue)); | 289 | (*currentIface) = QString("iface %1 %2 %3").arg(name).arg(getInterfaceFamily(returnValue)).arg(getInterfaceMethod(returnValue)); |
290 | return !returnValue; | 290 | return !returnValue; |
@@ -298,3 +298,3 @@ bool Interfaces::setInterfaceName(QString newName){ | |||
298 | */ | 298 | */ |
299 | bool Interfaces::setInterfaceFamily(QString newName){ | 299 | bool Interfaces::setInterfaceFamily(const QString &newName){ |
300 | if(currentIface == interfaces.end()) | 300 | if(currentIface == interfaces.end()) |
@@ -313,3 +313,3 @@ bool Interfaces::setInterfaceFamily(QString newName){ | |||
313 | */ | 313 | */ |
314 | bool Interfaces::setInterfaceMethod(QString newName){ | 314 | bool Interfaces::setInterfaceMethod(const QString &newName){ |
315 | if(currentIface == interfaces.end()) | 315 | if(currentIface == interfaces.end()) |
@@ -331,3 +331,3 @@ bool Interfaces::setInterfaceMethod(QString newName){ | |||
331 | */ | 331 | */ |
332 | QString Interfaces::getInterfaceOption(QString option, bool &error){ | 332 | QString Interfaces::getInterfaceOption(const QString &option, bool &error){ |
333 | return getOption(currentIface, option, error); | 333 | return getOption(currentIface, option, error); |
@@ -343,3 +343,3 @@ QString Interfaces::getInterfaceOption(QString option, bool &error){ | |||
343 | */ | 343 | */ |
344 | bool Interfaces::setInterfaceOption(QString option, QString value){ | 344 | bool Interfaces::setInterfaceOption(const QString &option, const QString &value){ |
345 | return setOption(currentIface, option, value); | 345 | return setOption(currentIface, option, value); |
@@ -354,3 +354,3 @@ bool Interfaces::setInterfaceOption(QString option, QString value){ | |||
354 | */ | 354 | */ |
355 | bool Interfaces::removeInterfaceOption(QString option, QString value){ | 355 | bool Interfaces::removeInterfaceOption(const QString &option, const QString &value){ |
356 | return removeOption(currentIface, option, value); | 356 | return removeOption(currentIface, option, value); |
@@ -373,6 +373,6 @@ bool Interfaces::removeAllInterfaceOptions(){ | |||
373 | */ | 373 | */ |
374 | bool Interfaces::setMapping(QString interface){ | 374 | bool Interfaces::setMapping(const QString &interface){ |
375 | interface = interface.simplifyWhiteSpace(); | 375 | QString interfaceName = interface.simplifyWhiteSpace(); |
376 | interface = interface.replace(QRegExp(" "), ""); | 376 | interfaceName = interfaceName.replace(QRegExp(" "), ""); |
377 | return setStanza(MAPPING, interface, currentMapping); | 377 | return setStanza(MAPPING, interfaceName, currentMapping); |
378 | } | 378 | } |
@@ -383,3 +383,3 @@ bool Interfaces::setMapping(QString interface){ | |||
383 | */ | 383 | */ |
384 | void Interfaces::addMapping(QString option){ | 384 | void Interfaces::addMapping(const QString &option){ |
385 | interfaces.append(""); | 385 | interfaces.append(""); |
@@ -405,3 +405,3 @@ bool Interfaces::removeMapping(){ | |||
405 | */ | 405 | */ |
406 | bool Interfaces::setMap(QString map, QString value){ | 406 | bool Interfaces::setMap(const QString &map, const QString &value){ |
407 | return setOption(currentMapping, map, value); | 407 | return setOption(currentMapping, map, value); |
@@ -415,3 +415,3 @@ bool Interfaces::setMap(QString map, QString value){ | |||
415 | */ | 415 | */ |
416 | bool Interfaces::removeMap(QString map, QString value){ | 416 | bool Interfaces::removeMap(const QString &map, const QString &value){ |
417 | return removeOption(currentMapping, map, value); | 417 | return removeOption(currentMapping, map, value); |
@@ -425,3 +425,3 @@ bool Interfaces::removeMap(QString map, QString value){ | |||
425 | */ | 425 | */ |
426 | QString Interfaces::getMap(QString map, bool &error){ | 426 | QString Interfaces::getMap(const QString &map, bool &error){ |
427 | return getOption(currentMapping, map, error); | 427 | return getOption(currentMapping, map, error); |
@@ -434,3 +434,3 @@ QString Interfaces::getMap(QString map, bool &error){ | |||
434 | */ | 434 | */ |
435 | bool Interfaces::setScript(QString argument){ | 435 | bool Interfaces::setScript(const QString &argument){ |
436 | return setOption(currentMapping, "script", argument); | 436 | return setOption(currentMapping, "script", argument); |
@@ -446,2 +446,4 @@ QString Interfaces::getScript(bool &error){ | |||
446 | 446 | ||
447 | |||
448 | |||
447 | /** | 449 | /** |
@@ -454,3 +456,3 @@ QString Interfaces::getScript(bool &error){ | |||
454 | */ | 456 | */ |
455 | bool Interfaces::setStanza(QString stanza, QString option, QStringList::Iterator &iterator){ | 457 | bool Interfaces::setStanza(const QString &stanza, const QString &option, QStringList::Iterator &iterator){ |
456 | bool found = false; | 458 | bool found = false; |
@@ -491,3 +493,3 @@ bool Interfaces::setStanza(QString stanza, QString option, QStringList::Iterator | |||
491 | */ | 493 | */ |
492 | bool Interfaces::setOption(QStringList::Iterator start, QString option, QString value){ | 494 | bool Interfaces::setOption(const QStringList::Iterator &start, const QString &option, const QString &value){ |
493 | if(start == interfaces.end()) | 495 | if(start == interfaces.end()) |
@@ -526,3 +528,3 @@ bool Interfaces::setOption(QStringList::Iterator start, QString option, QString | |||
526 | */ | 528 | */ |
527 | bool Interfaces::removeOption(QStringList::Iterator start, QString option, QString value){ | 529 | bool Interfaces::removeOption(const QStringList::Iterator &start, const QString &option, const QString &value){ |
528 | if(start == interfaces.end()) | 530 | if(start == interfaces.end()) |
@@ -552,3 +554,3 @@ bool Interfaces::removeOption(QStringList::Iterator start, QString option, QStri | |||
552 | */ | 554 | */ |
553 | bool Interfaces::removeAllOptions(QStringList::Iterator start){ | 555 | bool Interfaces::removeAllOptions(const QStringList::Iterator &start){ |
554 | if(start == interfaces.end()) | 556 | if(start == interfaces.end()) |
@@ -577,3 +579,3 @@ bool Interfaces::removeAllOptions(QStringList::Iterator start){ | |||
577 | */ | 579 | */ |
578 | QString Interfaces::getOption(QStringList::Iterator start, QString option, bool &error){ | 580 | QString Interfaces::getOption(const QStringList::Iterator &start, const QString &option, bool &error){ |
579 | if(start == interfaces.end()){ | 581 | if(start == interfaces.end()){ |
diff --git a/noncore/settings/networksettings/interfaces/interfaces.h b/noncore/settings/networksettings/interfaces/interfaces.h index e09ea71..26abb73 100644 --- a/noncore/settings/networksettings/interfaces/interfaces.h +++ b/noncore/settings/networksettings/interfaces/interfaces.h | |||
@@ -27,29 +27,29 @@ public: | |||
27 | 27 | ||
28 | bool isAuto(QString interface); | 28 | bool isAuto(const QString &interface); |
29 | bool setAuto(QString interface, bool setAuto); | 29 | bool setAuto(const QString &interface, bool setAuto); |
30 | 30 | ||
31 | bool removeInterface(); | 31 | bool removeInterface(); |
32 | bool addInterface(QString interface, QString family, QString method); | 32 | bool addInterface(const QString &interface, const QString &family, const QString &method); |
33 | bool copyInterface(QString oldInterface, QString newInterface); | 33 | bool copyInterface(const QString &oldInterface, const QString &newInterface); |
34 | bool setInterface(QString interface); | 34 | bool setInterface(QString interface); |
35 | bool isInterfaceSet(); | 35 | inline bool isInterfaceSet(); |
36 | QString getInterfaceName(bool &error); | 36 | QString getInterfaceName(bool &error); |
37 | bool setInterfaceName(QString newName); | 37 | bool setInterfaceName(const QString &newName); |
38 | QString getInterfaceFamily(bool &error); | 38 | QString getInterfaceFamily(bool &error); |
39 | bool setInterfaceFamily(QString newName); | 39 | bool setInterfaceFamily(const QString &newName); |
40 | QString getInterfaceMethod(bool &error); | 40 | QString getInterfaceMethod(bool &error); |
41 | bool setInterfaceMethod(QString newName); | 41 | bool setInterfaceMethod(const QString &newName); |
42 | QString getInterfaceOption(QString option, bool &error); | 42 | inline QString getInterfaceOption(const QString &option, bool &error); |
43 | bool setInterfaceOption(QString option, QString value); | 43 | inline bool setInterfaceOption(const QString &option, const QString &value); |
44 | bool removeInterfaceOption(QString option, QString value); | 44 | inline bool removeInterfaceOption(const QString &option, const QString &value); |
45 | bool removeAllInterfaceOptions(); | 45 | inline bool removeAllInterfaceOptions(); |
46 | 46 | ||
47 | bool setMapping(QString interface); | 47 | bool setMapping(const QString &interface); |
48 | bool removeMapping(); | 48 | bool removeMapping(); |
49 | void addMapping(QString options); | 49 | inline void addMapping(const QString &options); |
50 | bool setMap(QString map, QString value); | 50 | inline bool setMap(const QString &map, const QString &value); |
51 | bool removeMap(QString map, QString value); | 51 | inline bool removeMap(const QString &map, const QString &value); |
52 | QString getMap(QString map, bool &error); | 52 | inline QString getMap(const QString &map, bool &error); |
53 | bool setScript(QString); | 53 | inline bool setScript(const QString &argument); |
54 | QString getScript(bool &error); | 54 | inline QString getScript(bool &error); |
55 | 55 | ||
@@ -58,7 +58,7 @@ public: | |||
58 | private: | 58 | private: |
59 | bool setStanza(QString stanza, QString option,QStringList::Iterator &iterator); | 59 | bool setStanza(const QString &stanza, const QString &option, QStringList::Iterator &iterator); |
60 | bool setOption(QStringList::Iterator start, QString option, QString value); | 60 | bool setOption(const QStringList::Iterator &start, const QString &option, const QString &value); |
61 | bool removeOption(QStringList::Iterator start, QString option, QString value); | 61 | bool removeOption(const QStringList::Iterator &start, const QString &option, const QString &value); |
62 | QString getOption(QStringList::Iterator start, QString option, bool &error); | 62 | QString getOption(const QStringList::Iterator &start, const QString &option, bool &error); |
63 | bool removeAllOptions(QStringList::Iterator start); | 63 | bool removeAllOptions(const QStringList::Iterator &start); |
64 | 64 | ||
diff --git a/noncore/settings/networksettings/interfaces/interfacesetup.ui b/noncore/settings/networksettings/interfaces/interfacesetup.ui index ab8e413..df55d25 100644 --- a/noncore/settings/networksettings/interfaces/interfacesetup.ui +++ b/noncore/settings/networksettings/interfaces/interfacesetup.ui | |||
@@ -101,2 +101,6 @@ | |||
101 | <property stdset="1"> | 101 | <property stdset="1"> |
102 | <name>lineStep</name> | ||
103 | <number>24</number> | ||
104 | </property> | ||
105 | <property stdset="1"> | ||
102 | <name>value</name> | 106 | <name>value</name> |
@@ -253,2 +257,24 @@ | |||
253 | </widget> | 257 | </widget> |
258 | <customwidgets> | ||
259 | <customwidget> | ||
260 | <class>QWidget</class> | ||
261 | <header location="local">qwidget.h</header> | ||
262 | <sizehint> | ||
263 | <width>100</width> | ||
264 | <height>100</height> | ||
265 | </sizehint> | ||
266 | <container>0</container> | ||
267 | <sizepolicy> | ||
268 | <hordata>7</hordata> | ||
269 | <verdata>7</verdata> | ||
270 | </sizepolicy> | ||
271 | <pixmap>image0</pixmap> | ||
272 | </customwidget> | ||
273 | </customwidgets> | ||
274 | <images> | ||
275 | <image> | ||
276 | <name>image0</name> | ||
277 | <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> | ||
278 | </image> | ||
279 | </images> | ||
254 | <connections> | 280 | <connections> |
diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.h b/noncore/settings/networksettings/interfaces/interfacesetupimp.h index a88e190..60933aa 100644 --- a/noncore/settings/networksettings/interfaces/interfacesetupimp.h +++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.h | |||
@@ -23,3 +23,2 @@ private: | |||
23 | Interface *interface; | 23 | Interface *interface; |
24 | |||
25 | }; | 24 | }; |
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 | |||
@@ -32,3 +32,3 @@ | |||
32 | 32 | ||
33 | MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(parent, name, true), advancedUserMode(false){ | 33 | MainWindowImp::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())); |
@@ -191,3 +191,3 @@ void MainWindowImp::getAllInterfaces(){ | |||
191 | */ | 191 | */ |
192 | void MainWindowImp::loadModules(QString path){ | 192 | void MainWindowImp::loadModules(const QString &path){ |
193 | //qDebug(path.latin1()); | 193 | //qDebug(path.latin1()); |
@@ -216,3 +216,3 @@ void MainWindowImp::loadModules(QString path){ | |||
216 | */ | 216 | */ |
217 | Module* MainWindowImp::loadPlugin(QString pluginFileName, QString resolveString){ | 217 | Module* 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()); |
diff --git a/noncore/settings/networksettings/mainwindowimp.h b/noncore/settings/networksettings/mainwindowimp.h index 382428c..4f09d6c 100644 --- a/noncore/settings/networksettings/mainwindowimp.h +++ b/noncore/settings/networksettings/mainwindowimp.h | |||
@@ -35,6 +35,6 @@ private slots: | |||
35 | private: | 35 | private: |
36 | void loadModules(QString path); | 36 | void loadModules(const QString &path); |
37 | 37 | ||
38 | Module* loadPlugin(QString pluginFileName, | 38 | Module* loadPlugin(const QString &pluginFileName, |
39 | QString resolveString = "create_plugin"); | 39 | const QString &resolveString = "create_plugin"); |
40 | 40 | ||
diff --git a/noncore/settings/networksettings/module.h b/noncore/settings/networksettings/module.h index 92b125a..2e6272b 100644 --- a/noncore/settings/networksettings/module.h +++ b/noncore/settings/networksettings/module.h | |||
@@ -24,3 +24,3 @@ public: | |||
24 | */ | 24 | */ |
25 | virtual void setProfile(QString newProfile) = 0; | 25 | virtual void setProfile(const QString &newProfile) = 0; |
26 | 26 | ||
@@ -72,3 +72,3 @@ public: | |||
72 | */ | 72 | */ |
73 | virtual Interface *addNewInterface(QString name) = 0; | 73 | virtual Interface *addNewInterface(const QString &name) = 0; |
74 | 74 | ||
diff --git a/noncore/settings/networksettings/wlan/infoimp.h b/noncore/settings/networksettings/wlan/infoimp.h index 5311bea..8f7f0d6 100644 --- a/noncore/settings/networksettings/wlan/infoimp.h +++ b/noncore/settings/networksettings/wlan/infoimp.h | |||
@@ -6,3 +6,3 @@ | |||
6 | class QTimer; | 6 | class QTimer; |
7 | class WExtensions; | 7 | //class WExtensions; |
8 | 8 | ||
diff --git a/noncore/settings/networksettings/wlan/wextensions.cpp b/noncore/settings/networksettings/wlan/wextensions.cpp index eb6fc42..6335ebc 100644 --- a/noncore/settings/networksettings/wlan/wextensions.cpp +++ b/noncore/settings/networksettings/wlan/wextensions.cpp | |||
@@ -18,4 +18,3 @@ | |||
18 | */ | 18 | */ |
19 | WExtensions::WExtensions(QString interfaceName): hasWirelessExtensions(false){ | 19 | WExtensions::WExtensions(QString interfaceName): hasWirelessExtensions(false), interface(interfaceName) { |
20 | interface = interfaceName; | ||
21 | fd = socket( AF_INET, SOCK_DGRAM, 0 ); | 20 | fd = socket( AF_INET, SOCK_DGRAM, 0 ); |
diff --git a/noncore/settings/networksettings/wlan/wlanimp.cpp b/noncore/settings/networksettings/wlan/wlanimp.cpp index 689eae2..d4b4af9 100644 --- a/noncore/settings/networksettings/wlan/wlanimp.cpp +++ b/noncore/settings/networksettings/wlan/wlanimp.cpp | |||
@@ -46,3 +46,3 @@ WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, W | |||
46 | */ | 46 | */ |
47 | void WLANImp::setProfile(QString &profile){ | 47 | void WLANImp::setProfile(const QString &profile){ |
48 | interfaceSetup->setProfile(profile); | 48 | interfaceSetup->setProfile(profile); |
diff --git a/noncore/settings/networksettings/wlan/wlanimp.h b/noncore/settings/networksettings/wlan/wlanimp.h index f88e550..df599af 100644 --- a/noncore/settings/networksettings/wlan/wlanimp.h +++ b/noncore/settings/networksettings/wlan/wlanimp.h | |||
@@ -15,3 +15,3 @@ public: | |||
15 | WLANImp( QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = FALSE, WFlags fl = 0 ); | 15 | WLANImp( QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = FALSE, WFlags fl = 0 ); |
16 | void setProfile(QString &profile); | 16 | void setProfile(const QString &profile); |
17 | 17 | ||
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp index b14fc0a..3979e60 100644 --- a/noncore/settings/networksettings/wlan/wlanmodule.cpp +++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp | |||
@@ -28,3 +28,3 @@ WLANModule::~WLANModule(){ | |||
28 | */ | 28 | */ |
29 | void WLANModule::setProfile(QString newProfile){ | 29 | void WLANModule::setProfile(const QString &newProfile){ |
30 | profile = newProfile; | 30 | profile = newProfile; |
@@ -96,3 +96,3 @@ QList<Interface> WLANModule::getInterfaces(){ | |||
96 | */ | 96 | */ |
97 | Interface *WLANModule::addNewInterface(QString ){ | 97 | Interface *WLANModule::addNewInterface(const QString &){ |
98 | // We can't add a 802.11 interface, either the hardware will be there | 98 | // We can't add a 802.11 interface, either the hardware will be there |
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.h b/noncore/settings/networksettings/wlan/wlanmodule.h index a81ccff..3a54de6 100644 --- a/noncore/settings/networksettings/wlan/wlanmodule.h +++ b/noncore/settings/networksettings/wlan/wlanmodule.h | |||
@@ -14,11 +14,11 @@ public: | |||
14 | 14 | ||
15 | virtual void setProfile(QString newProfile); | 15 | void setProfile(const QString &newProfile); |
16 | virtual bool isOwner(Interface *); | 16 | bool isOwner(Interface *); |
17 | virtual QWidget *configure(Interface *i); | 17 | QWidget *configure(Interface *i); |
18 | virtual QWidget *information(Interface *i); | 18 | QWidget *information(Interface *i); |
19 | virtual QList<Interface> getInterfaces(); | 19 | QList<Interface> getInterfaces(); |
20 | virtual void possibleNewInterfaces(QMap<QString, QString> &){}; | 20 | void possibleNewInterfaces(QMap<QString, QString> &){}; |
21 | virtual Interface *addNewInterface(QString name); | 21 | Interface *addNewInterface(const QString &name); |
22 | virtual bool remove(Interface* i); | 22 | bool remove(Interface* i); |
23 | virtual QString getPixmapName(Interface* i); | 23 | QString getPixmapName(Interface* i); |
24 | 24 | ||