summaryrefslogtreecommitdiff
path: root/noncore/net/networksetup/interfaces
Unidiff
Diffstat (limited to 'noncore/net/networksetup/interfaces') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/networksetup/interfaces/interface.cpp2
-rw-r--r--noncore/net/networksetup/interfaces/interface.h19
-rw-r--r--noncore/net/networksetup/interfaces/interfaces.cpp62
-rw-r--r--noncore/net/networksetup/interfaces/interfaces.h48
-rw-r--r--noncore/net/networksetup/interfaces/interfacesetup.ui26
-rw-r--r--noncore/net/networksetup/interfaces/interfacesetupimp.h1
6 files changed, 92 insertions, 66 deletions
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
@@ -39,13 +39,13 @@ void Interface::setAttached(bool isAttached){
39 39
40/** 40/**
41 * Set Hardware name 41 * Set Hardware name
42 * @param name - the new name 42 * @param name - the new name
43 * emit updateInterface 43 * emit updateInterface
44 */ 44 */
45void Interface::setHardwareName(QString name){ 45void Interface::setHardwareName(const QString &name){
46 hardwareName = name; 46 hardwareName = name;
47 emit(updateInterface(this)); 47 emit(updateInterface(this));
48}; 48};
49 49
50/** 50/**
51 * Set Module owner 51 * Set Module owner
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
@@ -12,27 +12,26 @@ class Interface : public QObject{
12signals: 12signals:
13 void updateInterface(Interface *i); 13 void updateInterface(Interface *i);
14 void updateMessage(const QString &message); 14 void updateMessage(const QString &message);
15 15
16public: 16public:
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
34 // inet information. 33 // inet information.
35 QString getMacAddress(){ return macAddress; }; 34 QString getMacAddress(){ return macAddress; };
36 QString getIp(){ return ip; }; 35 QString getIp(){ return ip; };
37 QString getSubnetMask(){ return subnetMask; }; 36 QString getSubnetMask(){ return subnetMask; };
38 QString getBroadcast(){ return broadcast; }; 37 QString getBroadcast(){ return broadcast; };
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
@@ -67,13 +67,13 @@ QStringList Interfaces::getInterfaceList(){
67/** 67/**
68 * Find out if interface is in an "auto" group or not. 68 * Find out if interface is in an "auto" group or not.
69 * Report any duplicates such as eth0 being in two differnt auto's 69 * Report any duplicates such as eth0 being in two differnt auto's
70 * @param interface interface to check to see if it is on or not. 70 * @param interface interface to check to see if it is on or not.
71 * @return true is interface is in auto 71 * @return true is interface is in auto
72 */ 72 */
73bool Interfaces::isAuto(QString interface){ 73bool Interfaces::isAuto(const QString &interface){
74 QStringList autoLines = interfaces.grep(QRegExp(AUTO)); 74 QStringList autoLines = interfaces.grep(QRegExp(AUTO));
75 QStringList awi = autoLines.grep(QRegExp(interface)); 75 QStringList awi = autoLines.grep(QRegExp(interface));
76 if(awi.count() > 1) 76 if(awi.count() > 1)
77 qDebug(QString("Interfaces: Found more then auto group with interface: %1.").arg(interface).latin1()); 77 qDebug(QString("Interfaces: Found more then auto group with interface: %1.").arg(interface).latin1());
78 if(awi.count() < 1) 78 if(awi.count() < 1)
79 return false; 79 return false;
@@ -83,13 +83,13 @@ bool Interfaces::isAuto(QString interface){
83/** 83/**
84 * Attempt to set the auto option for interface to setAuto. 84 * Attempt to set the auto option for interface to setAuto.
85 * @param interface the interface to set 85 * @param interface the interface to set
86 * @param setAuto the value to set interface to. 86 * @param setAuto the value to set interface to.
87 * @return false if already set to setAuto. 87 * @return false if already set to setAuto.
88 * */ 88 * */
89bool Interfaces::setAuto(QString interface, bool setAuto){ 89bool 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.
91 if(isAuto(interface) == setAuto) 91 if(isAuto(interface) == setAuto)
92 return false; 92 return false;
93 93
94 bool changed = false; 94 bool changed = false;
95 for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) { 95 for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) {
@@ -153,28 +153,28 @@ bool Interfaces::isInterfaceSet(){
153 * removed from the interface name. 153 * removed from the interface name.
154 * @param family the family of this interface inet or inet, ipx or inet6 154 * @param family the family of this interface inet or inet, ipx or inet6
155 * Must of one of the families defined in interfaces.h 155 * Must of one of the families defined in interfaces.h
156 * @param method for the family. see interfaces man page for family methods. 156 * @param method for the family. see interfaces man page for family methods.
157 * @return true if successfull. 157 * @return true if successfull.
158 */ 158 */
159bool Interfaces::addInterface(QString interface, QString family, QString method){ 159bool 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;
167} 167}
168 168
169/** 169/**
170 * Copies interface with name interface to name newInterface 170 * Copies interface with name interface to name newInterface
171 * @param newInterface name of the new interface. 171 * @param newInterface name of the new interface.
172 * @return bool true if successfull 172 * @return bool true if successfull
173 */ 173 */
174bool Interfaces::copyInterface(QString interface, QString newInterface){ 174bool Interfaces::copyInterface(const QString &interface, const QString &newInterface){
175 if(!setInterface(interface)) return false; 175 if(!setInterface(interface)) return false;
176 176
177 QStringList::Iterator it = currentIface; 177 QStringList::Iterator it = currentIface;
178 it++; 178 it++;
179 179
180 bool error; 180 bool error;
@@ -277,29 +277,29 @@ QString Interfaces::getInterfaceMethod(bool &error){
277 277
278/** 278/**
279 * Sets the interface name to newName. 279 * Sets the interface name to newName.
280 * @param newName the new name of the interface. All whitespace is removed. 280 * @param newName the new name of the interface. All whitespace is removed.
281 * @return bool true if successfull. 281 * @return bool true if successfull.
282 */ 282 */
283bool Interfaces::setInterfaceName(QString newName){ 283bool 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;
291} 291}
292 292
293/** 293/**
294 * Sets the interface family to newName. 294 * Sets the interface family to newName.
295 * @param newName the new name of the interface. Must be one of the families 295 * @param newName the new name of the interface. Must be one of the families
296 * defined in the interfaces.h file. 296 * defined in the interfaces.h file.
297 * @return bool true if successfull. 297 * @return bool true if successfull.
298 */ 298 */
299bool Interfaces::setInterfaceFamily(QString newName){ 299bool Interfaces::setInterfaceFamily(const QString &newName){
300 if(currentIface == interfaces.end()) 300 if(currentIface == interfaces.end())
301 return false; 301 return false;
302 if(acceptedFamily.contains(newName)==0) 302 if(acceptedFamily.contains(newName)==0)
303 return false; 303 return false;
304 bool returnValue = false; 304 bool returnValue = false;
305 (*currentIface) = QString("iface %1 %2 %3").arg(getInterfaceName(returnValue)).arg(newName).arg(getInterfaceMethod(returnValue)); 305 (*currentIface) = QString("iface %1 %2 %3").arg(getInterfaceName(returnValue)).arg(newName).arg(getInterfaceMethod(returnValue));
@@ -308,13 +308,13 @@ bool Interfaces::setInterfaceFamily(QString newName){
308 308
309/** 309/**
310 * Sets the interface method to newName 310 * Sets the interface method to newName
311 * @param newName the new name of the interface 311 * @param newName the new name of the interface
312 * @return bool true if successfull. 312 * @return bool true if successfull.
313 */ 313 */
314bool Interfaces::setInterfaceMethod(QString newName){ 314bool Interfaces::setInterfaceMethod(const QString &newName){
315 if(currentIface == interfaces.end()) 315 if(currentIface == interfaces.end())
316 return false; 316 return false;
317 bool returnValue = false; 317 bool returnValue = false;
318 (*currentIface) = QString("iface %1 %2 %3").arg(getInterfaceName(returnValue)).arg(getInterfaceFamily(returnValue)).arg(newName); 318 (*currentIface) = QString("iface %1 %2 %3").arg(getInterfaceName(returnValue)).arg(getInterfaceFamily(returnValue)).arg(newName);
319 return !returnValue; 319 return !returnValue;
320} 320}
@@ -326,36 +326,36 @@ bool Interfaces::setInterfaceMethod(QString newName){
326 * iface eth0 static 326 * iface eth0 static
327 * address 192.168.1.1 327 * address 192.168.1.1
328 * @param option the options to get the value. 328 * @param option the options to get the value.
329 * @param error set to true if any error occurs, false otherwise. 329 * @param error set to true if any error occurs, false otherwise.
330 * @return QString the options value. QString::null if error == true 330 * @return QString the options value. QString::null if error == true
331 */ 331 */
332QString Interfaces::getInterfaceOption(QString option, bool &error){ 332QString Interfaces::getInterfaceOption(const QString &option, bool &error){
333 return getOption(currentIface, option, error); 333 return getOption(currentIface, option, error);
334} 334}
335 335
336/** 336/**
337 * Set a value for an option in the currently selected interface. If option 337 * Set a value for an option in the currently selected interface. If option
338 * doesn't exist then it is added along with the value. 338 * doesn't exist then it is added along with the value.
339 * @param option the options to set the value. 339 * @param option the options to set the value.
340 * @param value the value that option should be set to. 340 * @param value the value that option should be set to.
341 * @param error set to true if any error occurs, false otherwise. 341 * @param error set to true if any error occurs, false otherwise.
342 * @return QString the options value. QString::null if error == true 342 * @return QString the options value. QString::null if error == true
343 */ 343 */
344bool Interfaces::setInterfaceOption(QString option, QString value){ 344bool Interfaces::setInterfaceOption(const QString &option, const QString &value){
345 return setOption(currentIface, option, value); 345 return setOption(currentIface, option, value);
346} 346}
347 347
348/** 348/**
349 * Removes a value for an option in the currently selected interface. 349 * Removes a value for an option in the currently selected interface.
350 * @param option the options to set the value. 350 * @param option the options to set the value.
351 * @param value the value that option should be set to. 351 * @param value the value that option should be set to.
352 * @param error set to true if any error occurs, false otherwise. 352 * @param error set to true if any error occurs, false otherwise.
353 * @return QString the options value. QString::null if error == true 353 * @return QString the options value. QString::null if error == true
354 */ 354 */
355bool Interfaces::removeInterfaceOption(QString option, QString value){ 355bool Interfaces::removeInterfaceOption(const QString &option, const QString &value){
356 return removeOption(currentIface, option, value); 356 return removeOption(currentIface, option, value);
357} 357}
358 358
359/** 359/**
360 * Removes all of the options from the currently selected interface. 360 * Removes all of the options from the currently selected interface.
361 * @return bool error if if successfull 361 * @return bool error if if successfull
@@ -368,23 +368,23 @@ bool Interfaces::removeAllInterfaceOptions(){
368 * Set the current map to interface's map. This needs to be done before you 368 * Set the current map to interface's map. This needs to be done before you
369 * can call addMapping(), set/getMap(), and get/setScript(). 369 * can call addMapping(), set/getMap(), and get/setScript().
370 * @param interface the name of the interface to set. All whitespace is 370 * @param interface the name of the interface to set. All whitespace is
371 * removed from the interface name. 371 * removed from the interface name.
372 * @return bool true if it is successfull. 372 * @return bool true if it is successfull.
373 */ 373 */
374bool Interfaces::setMapping(QString interface){ 374bool 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}
379 379
380/** 380/**
381 * Adds a new Mapping to the interfaces file with interfaces. 381 * Adds a new Mapping to the interfaces file with interfaces.
382 * @param interface the name(s) of the interfaces to set to this mapping 382 * @param interface the name(s) of the interfaces to set to this mapping
383 */ 383 */
384void Interfaces::addMapping(QString option){ 384void Interfaces::addMapping(const QString &option){
385 interfaces.append(""); 385 interfaces.append("");
386 interfaces.append(QString(MAPPING " %1").arg(option)); 386 interfaces.append(QString(MAPPING " %1").arg(option));
387} 387}
388 388
389/** 389/**
390 * Remove the currently selected map and all of its options. 390 * Remove the currently selected map and all of its options.
@@ -400,62 +400,64 @@ bool Interfaces::removeMapping(){
400/** 400/**
401 * Set a map option within a mapping. 401 * Set a map option within a mapping.
402 * @param map map to use 402 * @param map map to use
403 * @param value value to go with map 403 * @param value value to go with map
404 * @return bool true if it is successfull. 404 * @return bool true if it is successfull.
405 */ 405 */
406bool Interfaces::setMap(QString map, QString value){ 406bool Interfaces::setMap(const QString &map, const QString &value){
407 return setOption(currentMapping, map, value); 407 return setOption(currentMapping, map, value);
408} 408}
409 409
410/** 410/**
411 * Removes a map option within a mapping. 411 * Removes a map option within a mapping.
412 * @param map map to use 412 * @param map map to use
413 * @param value value to go with map 413 * @param value value to go with map
414 * @return bool true if it is successfull. 414 * @return bool true if it is successfull.
415 */ 415 */
416bool Interfaces::removeMap(QString map, QString value){ 416bool Interfaces::removeMap(const QString &map, const QString &value){
417 return removeOption(currentMapping, map, value); 417 return removeOption(currentMapping, map, value);
418} 418}
419 419
420/** 420/**
421 * Get a map value within a mapping. 421 * Get a map value within a mapping.
422 * @param map map to get value of 422 * @param map map to get value of
423 * @param bool true if it is successfull. 423 * @param bool true if it is successfull.
424 * @return value that goes to the map 424 * @return value that goes to the map
425 */ 425 */
426QString Interfaces::getMap(QString map, bool &error){ 426QString Interfaces::getMap(const QString &map, bool &error){
427 return getOption(currentMapping, map, error); 427 return getOption(currentMapping, map, error);
428} 428}
429 429
430/** 430/**
431 * Sets a script value of the current mapping to argument. 431 * Sets a script value of the current mapping to argument.
432 * @param argument the script name. 432 * @param argument the script name.
433 * @return true if successfull. 433 * @return true if successfull.
434 */ 434 */
435bool Interfaces::setScript(QString argument){ 435bool Interfaces::setScript(const QString &argument){
436 return setOption(currentMapping, "script", argument); 436 return setOption(currentMapping, "script", argument);
437} 437}
438 438
439/** 439/**
440 * @param error true if could not retrieve the current script argument. 440 * @param error true if could not retrieve the current script argument.
441 * @return QString the argument of the script for the current mapping. 441 * @return QString the argument of the script for the current mapping.
442 */ 442 */
443QString Interfaces::getScript(bool &error){ 443QString Interfaces::getScript(bool &error){
444 return getOption(currentMapping, "script", error); 444 return getOption(currentMapping, "script", error);
445} 445}
446 446
447
448
447/** 449/**
448 * Helper function used to parse through the QStringList and put pointers in 450 * Helper function used to parse through the QStringList and put pointers in
449 * the correct place. 451 * the correct place.
450 * @param stanza The stanza (auto, iface, mapping) to look for. 452 * @param stanza The stanza (auto, iface, mapping) to look for.
451 * @param option string that must be in the stanza's main line. 453 * @param option string that must be in the stanza's main line.
452 * @param interator interator to place at location of stanza if successfull. 454 * @param interator interator to place at location of stanza if successfull.
453 * @return bool true if the stanza is found. 455 * @return bool true if the stanza is found.
454 */ 456 */
455bool Interfaces::setStanza(QString stanza, QString option, QStringList::Iterator &iterator){ 457bool Interfaces::setStanza(const QString &stanza, const QString &option, QStringList::Iterator &iterator){
456 bool found = false; 458 bool found = false;
457 iterator = interfaces.end(); 459 iterator = interfaces.end();
458 for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) { 460 for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) {
459 QString line = (*it).simplifyWhiteSpace(); 461 QString line = (*it).simplifyWhiteSpace();
460 if(line.contains(stanza) && line.contains(option) && line.at(0) != '#'){ 462 if(line.contains(stanza) && line.contains(option) && line.at(0) != '#'){
461 uint point = line.find(option); 463 uint point = line.find(option);
@@ -486,13 +488,13 @@ bool Interfaces::setStanza(QString stanza, QString option, QStringList::Iterator
486/** 488/**
487 * Sets a value of an option in a stanza 489 * Sets a value of an option in a stanza
488 * @param start the start of the stanza 490 * @param start the start of the stanza
489 * @param option the option to use when setting value. 491 * @param option the option to use when setting value.
490 * @return bool true if successfull, false otherwise. 492 * @return bool true if successfull, false otherwise.
491 */ 493 */
492bool Interfaces::setOption(QStringList::Iterator start, QString option, QString value){ 494bool Interfaces::setOption(const QStringList::Iterator &start, const QString &option, const QString &value){
493 if(start == interfaces.end()) 495 if(start == interfaces.end())
494 return false; 496 return false;
495 497
496 bool found = false; 498 bool found = false;
497 for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) { 499 for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) {
498 if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){ 500 if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){
@@ -521,13 +523,13 @@ bool Interfaces::setOption(QStringList::Iterator start, QString option, QString
521/** 523/**
522 * Removes a option in a stanza 524 * Removes a option in a stanza
523 * @param start the start of the stanza 525 * @param start the start of the stanza
524 * @param option the option to use when setting value. 526 * @param option the option to use when setting value.
525 * @return bool true if successfull, false otherwise. 527 * @return bool true if successfull, false otherwise.
526 */ 528 */
527bool Interfaces::removeOption(QStringList::Iterator start, QString option, QString value){ 529bool Interfaces::removeOption(const QStringList::Iterator &start, const QString &option, const QString &value){
528 if(start == interfaces.end()) 530 if(start == interfaces.end())
529 return false; 531 return false;
530 532
531 bool found = false; 533 bool found = false;
532 for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) { 534 for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) {
533 if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){ 535 if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){
@@ -547,13 +549,13 @@ bool Interfaces::removeOption(QStringList::Iterator start, QString option, QStri
547 549
548/** 550/**
549 * Removes all options in a stanza 551 * Removes all options in a stanza
550 * @param start the start of the stanza 552 * @param start the start of the stanza
551 * @return bool true if successfull, false otherwise. 553 * @return bool true if successfull, false otherwise.
552 */ 554 */
553bool Interfaces::removeAllOptions(QStringList::Iterator start){ 555bool Interfaces::removeAllOptions(const QStringList::Iterator &start){
554 if(start == interfaces.end()) 556 if(start == interfaces.end())
555 return false; 557 return false;
556 558
557 QStringList::Iterator it = start; 559 QStringList::Iterator it = start;
558 it = ++it; 560 it = ++it;
559 for (; it != interfaces.end(); ++it ) { 561 for (; it != interfaces.end(); ++it ) {
@@ -572,13 +574,13 @@ bool Interfaces::removeAllOptions(QStringList::Iterator start){
572 * Gets a value of an option in a stanza 574 * Gets a value of an option in a stanza
573 * @param start the start of the stanza 575 * @param start the start of the stanza
574 * @param option the option to use when getting the value. 576 * @param option the option to use when getting the value.
575 * @param bool true if errors false otherwise. 577 * @param bool true if errors false otherwise.
576 * @return QString the value of option QString::null() if error == true. 578 * @return QString the value of option QString::null() if error == true.
577 */ 579 */
578QString Interfaces::getOption(QStringList::Iterator start, QString option, bool &error){ 580QString Interfaces::getOption(const QStringList::Iterator &start, const QString &option, bool &error){
579 if(start == interfaces.end()){ 581 if(start == interfaces.end()){
580 error = false; 582 error = false;
581 return QString(); 583 return QString();
582 } 584 }
583 585
584 QString value; 586 QString value;
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
@@ -22,48 +22,48 @@
22class Interfaces { 22class Interfaces {
23 23
24public: 24public:
25 Interfaces(QString useInterfacesFile = "/etc/network/interfaces"); 25 Interfaces(QString useInterfacesFile = "/etc/network/interfaces");
26 QStringList getInterfaceList(); 26 QStringList getInterfaceList();
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
56 bool write(); 56 bool write();
57 57
58private: 58private:
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
65 QString interfacesFile; 65 QString interfacesFile;
66 QStringList interfaces; 66 QStringList interfaces;
67 QStringList::Iterator currentIface; 67 QStringList::Iterator currentIface;
68 QStringList::Iterator currentMapping; 68 QStringList::Iterator currentMapping;
69 69
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
@@ -96,12 +96,16 @@
96 </property> 96 </property>
97 <property stdset="1"> 97 <property stdset="1">
98 <name>minValue</name> 98 <name>minValue</name>
99 <number>1</number> 99 <number>1</number>
100 </property> 100 </property>
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>
103 <number>168</number> 107 <number>168</number>
104 </property> 108 </property>
105 </widget> 109 </widget>
106 </hbox> 110 </hbox>
107 </widget> 111 </widget>
@@ -248,12 +252,34 @@
248 <height>20</height> 252 <height>20</height>
249 </size> 253 </size>
250 </property> 254 </property>
251 </spacer> 255 </spacer>
252 </vbox> 256 </vbox>
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>
255 <connection> 281 <connection>
256 <sender>dhcpCheckBox</sender> 282 <sender>dhcpCheckBox</sender>
257 <signal>toggled(bool)</signal> 283 <signal>toggled(bool)</signal>
258 <receiver>leaseHoursLabel</receiver> 284 <receiver>leaseHoursLabel</receiver>
259 <slot>setEnabled(bool)</slot> 285 <slot>setEnabled(bool)</slot>
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
@@ -18,13 +18,12 @@ public slots:
18 void setProfile(const QString &profile); 18 void setProfile(const QString &profile);
19 bool saveSettings(); 19 bool saveSettings();
20 20
21private: 21private:
22 Interfaces *interfaces; 22 Interfaces *interfaces;
23 Interface *interface; 23 Interface *interface;
24
25}; 24};
26 25
27 26
28#include <qlayout.h> 27#include <qlayout.h>
29 28
30class InterfaceSetupImpDialog : public QDialog { 29class InterfaceSetupImpDialog : public QDialog {