From d79ae2969e74b1caa8e562910715df4ffe1739b3 Mon Sep 17 00:00:00 2001 From: benmeyer Date: Mon, 30 Sep 2002 14:46:34 +0000 Subject: Fixed compiler warnings --- diff --git a/noncore/net/networksetup/interface.cpp b/noncore/net/networksetup/interface.cpp index b9b09ad..f6eed00 100644 --- a/noncore/net/networksetup/interface.cpp +++ b/noncore/net/networksetup/interface.cpp @@ -195,7 +195,7 @@ bool Interface::refresh(){ long time = 0; // Grab the start time // pid com state ppid pgrp session tty_nr tpgid flags - int r = sscanf(line.latin1(), "%*d %*s %*c %*d %*d %*d %*d %*d %*u " + sscanf(line.latin1(), "%*d %*s %*c %*d %*d %*d %*d %*d %*u " // minflt cminflt majflt cmajflt utime stime cutime cstime priority "%*u %*u %*u %*u %*u %*u %*d %*d %*d " // nice 0 itrealvalue starttime diff --git a/noncore/net/networksetup/interfaceinformationimp.h b/noncore/net/networksetup/interfaceinformationimp.h index 6fc2384..c8a478e 100644 --- a/noncore/net/networksetup/interfaceinformationimp.h +++ b/noncore/net/networksetup/interfaceinformationimp.h @@ -18,9 +18,9 @@ private slots: void refresh(); void restart(); void advanced(); - Interface *interface; private: + Interface *interface; void updateInterface(); }; diff --git a/noncore/net/networksetup/mainwindowimp.cpp b/noncore/net/networksetup/mainwindowimp.cpp index 3c13143..ad9362f 100644 --- a/noncore/net/networksetup/mainwindowimp.cpp +++ b/noncore/net/networksetup/mainwindowimp.cpp @@ -2,6 +2,9 @@ #include "addserviceimp.h" #include "interfaceinformationimp.h" #include "interfacesetupimp.h" +#include "interface.h" +#include "kprocess.h" +#include "module.h" #include #include @@ -50,12 +53,20 @@ MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(par loadModules(path); getInterfaceList(); serviceList->header()->hide(); + + + Config cfg("NetworkSetup"); + profiles = QStringList::split(" ", cfg.readEntry("Profiles", "All")); } /** - * Deconstructor. Unload libraries and save. + * Deconstructor. Unload libraries and save profile list. */ MainWindowImp::~MainWindowImp(){ + if(profiles.count() > 1){ + Config cfg("NetworkSetup"); + cfg.writeEntry("Profiles", profiles.join(" ")); + } } void MainWindowImp::loadModules(QString path){ @@ -252,7 +263,7 @@ void MainWindowImp::jobDone(KProcess *process){ if(macAddress == -1) macAddress = line.length(); if(hardwareName != -1) - i->setHardwareName(line.mid(hardwareName+11, macAddress-(hardwareName+11))); + i->setHardwareName(line.mid(hardwareName+11, macAddress-(hardwareName+11)) + QString(" (%1)").arg(i->getInterfaceName())); // We have found an interface //qDebug(QString("MainWindowImp: Found Interface: %1").arg(line).latin1()); interfaceNames.insert(i->getInterfaceName(), i); diff --git a/noncore/net/networksetup/mainwindowimp.h b/noncore/net/networksetup/mainwindowimp.h index 95ec2a1..0618dd2 100644 --- a/noncore/net/networksetup/mainwindowimp.h +++ b/noncore/net/networksetup/mainwindowimp.h @@ -2,12 +2,13 @@ #define MAINWINOWIMP_H #include "mainwindow.h" -#include "module.h" -#include "interface.h" -#include "kprocess.h" #include +#include +class Module; +class Interface; class QLibrary; +class KProcess; class MainWindowImp : public MainWindow { Q_OBJECT @@ -45,6 +46,8 @@ private: QMap interfaceItems; QMap threads; + QStringList profiles; + }; #endif diff --git a/noncore/settings/networksettings/interface.cpp b/noncore/settings/networksettings/interface.cpp index b9b09ad..f6eed00 100644 --- a/noncore/settings/networksettings/interface.cpp +++ b/noncore/settings/networksettings/interface.cpp @@ -195,7 +195,7 @@ bool Interface::refresh(){ long time = 0; // Grab the start time // pid com state ppid pgrp session tty_nr tpgid flags - int r = sscanf(line.latin1(), "%*d %*s %*c %*d %*d %*d %*d %*d %*u " + sscanf(line.latin1(), "%*d %*s %*c %*d %*d %*d %*d %*d %*u " // minflt cminflt majflt cmajflt utime stime cutime cstime priority "%*u %*u %*u %*u %*u %*u %*d %*d %*d " // nice 0 itrealvalue starttime diff --git a/noncore/settings/networksettings/interfaceinformationimp.h b/noncore/settings/networksettings/interfaceinformationimp.h index 6fc2384..c8a478e 100644 --- a/noncore/settings/networksettings/interfaceinformationimp.h +++ b/noncore/settings/networksettings/interfaceinformationimp.h @@ -18,9 +18,9 @@ private slots: void refresh(); void restart(); void advanced(); - Interface *interface; private: + Interface *interface; void updateInterface(); }; diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp index 3c13143..ad9362f 100644 --- a/noncore/settings/networksettings/mainwindowimp.cpp +++ b/noncore/settings/networksettings/mainwindowimp.cpp @@ -2,6 +2,9 @@ #include "addserviceimp.h" #include "interfaceinformationimp.h" #include "interfacesetupimp.h" +#include "interface.h" +#include "kprocess.h" +#include "module.h" #include #include @@ -50,12 +53,20 @@ MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(par loadModules(path); getInterfaceList(); serviceList->header()->hide(); + + + Config cfg("NetworkSetup"); + profiles = QStringList::split(" ", cfg.readEntry("Profiles", "All")); } /** - * Deconstructor. Unload libraries and save. + * Deconstructor. Unload libraries and save profile list. */ MainWindowImp::~MainWindowImp(){ + if(profiles.count() > 1){ + Config cfg("NetworkSetup"); + cfg.writeEntry("Profiles", profiles.join(" ")); + } } void MainWindowImp::loadModules(QString path){ @@ -252,7 +263,7 @@ void MainWindowImp::jobDone(KProcess *process){ if(macAddress == -1) macAddress = line.length(); if(hardwareName != -1) - i->setHardwareName(line.mid(hardwareName+11, macAddress-(hardwareName+11))); + i->setHardwareName(line.mid(hardwareName+11, macAddress-(hardwareName+11)) + QString(" (%1)").arg(i->getInterfaceName())); // We have found an interface //qDebug(QString("MainWindowImp: Found Interface: %1").arg(line).latin1()); interfaceNames.insert(i->getInterfaceName(), i); diff --git a/noncore/settings/networksettings/mainwindowimp.h b/noncore/settings/networksettings/mainwindowimp.h index 95ec2a1..0618dd2 100644 --- a/noncore/settings/networksettings/mainwindowimp.h +++ b/noncore/settings/networksettings/mainwindowimp.h @@ -2,12 +2,13 @@ #define MAINWINOWIMP_H #include "mainwindow.h" -#include "module.h" -#include "interface.h" -#include "kprocess.h" #include +#include +class Module; +class Interface; class QLibrary; +class KProcess; class MainWindowImp : public MainWindow { Q_OBJECT @@ -45,6 +46,8 @@ private: QMap interfaceItems; QMap threads; + QStringList profiles; + }; #endif -- cgit v0.9.0.2