summaryrefslogtreecommitdiff
path: root/noncore/settings
authorbenmeyer <benmeyer>2002-09-30 14:46:34 (UTC)
committer benmeyer <benmeyer>2002-09-30 14:46:34 (UTC)
commitd79ae2969e74b1caa8e562910715df4ffe1739b3 (patch) (unidiff)
tree1808d0d3747581ca999ec42b4bb029471a1aa199 /noncore/settings
parent9965bd5c49ff2f22d640d132ac343fdec97b3fb4 (diff)
downloadopie-d79ae2969e74b1caa8e562910715df4ffe1739b3.zip
opie-d79ae2969e74b1caa8e562910715df4ffe1739b3.tar.gz
opie-d79ae2969e74b1caa8e562910715df4ffe1739b3.tar.bz2
Fixed compiler warnings
Diffstat (limited to 'noncore/settings') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings/interface.cpp2
-rw-r--r--noncore/settings/networksettings/interfaceinformationimp.h2
-rw-r--r--noncore/settings/networksettings/mainwindowimp.cpp15
-rw-r--r--noncore/settings/networksettings/mainwindowimp.h9
4 files changed, 21 insertions, 7 deletions
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
@@ -186,25 +186,25 @@ bool Interface::refresh(){
186 stream.setDevice( &file ); 186 stream.setDevice( &file );
187 if (!file.open(IO_ReadOnly)){ 187 if (!file.open(IO_ReadOnly)){
188 qDebug(QString("Interface: Can't open file: %1").arg(fileName).latin1()); 188 qDebug(QString("Interface: Can't open file: %1").arg(fileName).latin1());
189 return false; 189 return false;
190 } 190 }
191 while ( !stream.eof() ) { 191 while ( !stream.eof() ) {
192 line = stream.readLine(); 192 line = stream.readLine();
193 } 193 }
194 file.close(); 194 file.close();
195 long time = 0; 195 long time = 0;
196 // Grab the start time 196 // Grab the start time
197 // pid com state ppid pgrp session tty_nr tpgid flags 197 // pid com state ppid pgrp session tty_nr tpgid flags
198 int r = sscanf(line.latin1(), "%*d %*s %*c %*d %*d %*d %*d %*d %*u " 198 sscanf(line.latin1(), "%*d %*s %*c %*d %*d %*d %*d %*d %*u "
199 // minflt cminflt majflt cmajflt utime stime cutime cstime priority 199 // minflt cminflt majflt cmajflt utime stime cutime cstime priority
200 "%*u %*u %*u %*u %*u %*u %*d %*d %*d " 200 "%*u %*u %*u %*u %*u %*u %*d %*d %*d "
201 // nice 0 itrealvalue starttime 201 // nice 0 itrealvalue starttime
202 "%*d %*d %*d %lu", (long*) &time); 202 "%*d %*d %*d %lu", (long*) &time);
203 time = time/100; 203 time = time/100;
204 204
205 QDateTime datetime(QDateTime::currentDateTime()); 205 QDateTime datetime(QDateTime::currentDateTime());
206 206
207 // Get the uptime of the computer. 207 // Get the uptime of the computer.
208 QFile f("/proc/uptime"); 208 QFile f("/proc/uptime");
209 if ( f.open(IO_ReadOnly) ) { // file opened successfully 209 if ( f.open(IO_ReadOnly) ) { // file opened successfully
210 QTextStream t( &f ); // use a text stream 210 QTextStream t( &f ); // use a text stream
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
@@ -9,23 +9,23 @@ class InterfaceInformationImp : public InterfaceInformation {
9Q_OBJECT 9Q_OBJECT
10 10
11public: 11public:
12 InterfaceInformationImp(QWidget *parent=0, const char *name=0, Interface *i=0, WFlags f=0); 12 InterfaceInformationImp(QWidget *parent=0, const char *name=0, Interface *i=0, WFlags f=0);
13 ~InterfaceInformationImp(){}; 13 ~InterfaceInformationImp(){};
14 14
15private slots: 15private slots:
16 void start(); 16 void start();
17 void stop(); 17 void stop();
18 void refresh(); 18 void refresh();
19 void restart(); 19 void restart();
20 void advanced(); 20 void advanced();
21 Interface *interface;
22 21
23private: 22private:
23 Interface *interface;
24 void updateInterface(); 24 void updateInterface();
25 25
26}; 26};
27 27
28#endif 28#endif
29 29
30// addserviceimp.h 30// addserviceimp.h
31 31
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
@@ -1,16 +1,19 @@
1#include "mainwindowimp.h" 1#include "mainwindowimp.h"
2#include "addserviceimp.h" 2#include "addserviceimp.h"
3#include "interfaceinformationimp.h" 3#include "interfaceinformationimp.h"
4#include "interfacesetupimp.h" 4#include "interfacesetupimp.h"
5#include "interface.h"
6#include "kprocess.h"
7#include "module.h"
5 8
6#include <qpushbutton.h> 9#include <qpushbutton.h>
7#include <qdir.h> 10#include <qdir.h>
8#include <qtabwidget.h> 11#include <qtabwidget.h>
9#include <qmainwindow.h> 12#include <qmainwindow.h>
10#include <qmessagebox.h> 13#include <qmessagebox.h>
11#include <qlistbox.h> 14#include <qlistbox.h>
12#include <qpe/config.h> 15#include <qpe/config.h>
13#include <qpe/qlibrary.h> 16#include <qpe/qlibrary.h>
14#include <qpe/resource.h> 17#include <qpe/resource.h>
15#include <qlist.h> 18#include <qlist.h>
16 19
@@ -41,30 +44,38 @@ MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(par
41 pluginDir.mkdir( ( DirStr + "plugins/" ) ); 44 pluginDir.mkdir( ( DirStr + "plugins/" ) );
42 QString path = DirStr + "plugins"; 45 QString path = DirStr + "plugins";
43 pluginDir.setPath(path); 46 pluginDir.setPath(path);
44 if(!pluginDir.exists()){ 47 if(!pluginDir.exists()){
45 qDebug(QString("MainWindowImp: ERROR: %1 %2").arg(__FILE__).arg(__LINE__).latin1()); 48 qDebug(QString("MainWindowImp: ERROR: %1 %2").arg(__FILE__).arg(__LINE__).latin1());
46 return; 49 return;
47 } 50 }
48 51
49 // Load any saved services. 52 // Load any saved services.
50 loadModules(path); 53 loadModules(path);
51 getInterfaceList(); 54 getInterfaceList();
52 serviceList->header()->hide(); 55 serviceList->header()->hide();
56
57
58 Config cfg("NetworkSetup");
59 profiles = QStringList::split(" ", cfg.readEntry("Profiles", "All"));
53} 60}
54 61
55/** 62/**
56 * Deconstructor. Unload libraries and save. 63 * Deconstructor. Unload libraries and save profile list.
57 */ 64 */
58MainWindowImp::~MainWindowImp(){ 65MainWindowImp::~MainWindowImp(){
66 if(profiles.count() > 1){
67 Config cfg("NetworkSetup");
68 cfg.writeEntry("Profiles", profiles.join(" "));
69 }
59} 70}
60 71
61void MainWindowImp::loadModules(QString path){ 72void MainWindowImp::loadModules(QString path){
62} 73}
63 74
64/** 75/**
65 * Attempt to load a function and resolve a function. 76 * Attempt to load a function and resolve a function.
66 * @param pluginFileName - the name of the file in which to attempt to load 77 * @param pluginFileName - the name of the file in which to attempt to load
67 * @param resolveString - function pointer to resolve 78 * @param resolveString - function pointer to resolve
68 * @return pointer to the function with name resolveString or NULL 79 * @return pointer to the function with name resolveString or NULL
69 */ 80 */
70Module* MainWindowImp::loadPlugin(QString pluginFileName, QString resolveString){ 81Module* MainWindowImp::loadPlugin(QString pluginFileName, QString resolveString){
@@ -243,25 +254,25 @@ void MainWindowImp::jobDone(KProcess *process){
243 i->setStatus(true); 254 i->setStatus(true);
244 } 255 }
245 256
246 i->setAttached(true); 257 i->setAttached(true);
247 i->setInterfaceName(interfaceName); 258 i->setInterfaceName(interfaceName);
248 259
249 QString hardName = "Ethernet"; 260 QString hardName = "Ethernet";
250 int hardwareName = line.find("Link encap:"); 261 int hardwareName = line.find("Link encap:");
251 int macAddress = line.find("HWaddr"); 262 int macAddress = line.find("HWaddr");
252 if(macAddress == -1) 263 if(macAddress == -1)
253 macAddress = line.length(); 264 macAddress = line.length();
254 if(hardwareName != -1) 265 if(hardwareName != -1)
255 i->setHardwareName(line.mid(hardwareName+11, macAddress-(hardwareName+11))); 266 i->setHardwareName(line.mid(hardwareName+11, macAddress-(hardwareName+11)) + QString(" (%1)").arg(i->getInterfaceName()));
256 // We have found an interface 267 // We have found an interface
257 //qDebug(QString("MainWindowImp: Found Interface: %1").arg(line).latin1()); 268 //qDebug(QString("MainWindowImp: Found Interface: %1").arg(line).latin1());
258 interfaceNames.insert(i->getInterfaceName(), i); 269 interfaceNames.insert(i->getInterfaceName(), i);
259 updateInterface(i); 270 updateInterface(i);
260 } 271 }
261 } 272 }
262 file.close(); 273 file.close();
263 QFile::remove(fileName); 274 QFile::remove(fileName);
264} 275}
265 276
266void MainWindowImp::updateInterface(Interface *i){ 277void MainWindowImp::updateInterface(Interface *i){
267 QListViewItem *item = NULL; 278 QListViewItem *item = NULL;
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
@@ -1,22 +1,23 @@
1#ifndef MAINWINOWIMP_H 1#ifndef MAINWINOWIMP_H
2#define MAINWINOWIMP_H 2#define MAINWINOWIMP_H
3 3
4#include "mainwindow.h" 4#include "mainwindow.h"
5#include "module.h"
6#include "interface.h"
7#include "kprocess.h"
8#include <qmap.h> 5#include <qmap.h>
6#include <qstringlist.h>
9 7
8class Module;
9class Interface;
10class QLibrary; 10class QLibrary;
11class KProcess;
11 12
12class MainWindowImp : public MainWindow { 13class MainWindowImp : public MainWindow {
13 Q_OBJECT 14 Q_OBJECT
14 15
15public: 16public:
16 MainWindowImp(QWidget *parent=0, const char *name=0); 17 MainWindowImp(QWidget *parent=0, const char *name=0);
17 ~MainWindowImp(); 18 ~MainWindowImp();
18 19
19private slots: 20private slots:
20 void addClicked(); 21 void addClicked();
21 void removeClicked(); 22 void removeClicked();
22 void configureClicked(); 23 void configureClicked();
@@ -36,18 +37,20 @@ private:
36 Module* loadPlugin(QString pluginFileName, 37 Module* loadPlugin(QString pluginFileName,
37 QString resolveString = "create_plugin"); 38 QString resolveString = "create_plugin");
38 39
39 // For our local list of names 40 // For our local list of names
40 QMap<QString, Interface*> interfaceNames; 41 QMap<QString, Interface*> interfaceNames;
41 42
42 QMap<Module*, QLibrary*> libraries; 43 QMap<Module*, QLibrary*> libraries;
43 QMap<Interface*, Module*> modules; 44 QMap<Interface*, Module*> modules;
44 QMap<Interface*, QListViewItem*> items; 45 QMap<Interface*, QListViewItem*> items;
45 QMap<QListViewItem*, Interface*> interfaceItems; 46 QMap<QListViewItem*, Interface*> interfaceItems;
46 47
47 QMap<KProcess*, QString> threads; 48 QMap<KProcess*, QString> threads;
49 QStringList profiles;
50
48}; 51};
49 52
50#endif 53#endif
51 54
52// mainwindowimp.h 55// mainwindowimp.h
53 56