summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/wellenreiter/ChangeLog1
-rw-r--r--noncore/net/wellenreiter/gui/main.cpp21
2 files changed, 20 insertions, 2 deletions
diff --git a/noncore/net/wellenreiter/ChangeLog b/noncore/net/wellenreiter/ChangeLog
index 55e13fc..755ed76 100644
--- a/noncore/net/wellenreiter/ChangeLog
+++ b/noncore/net/wellenreiter/ChangeLog
@@ -1,5 +1,6 @@
1 2004-??-?? Michael Lauer <mickey@Vanille.de> 1 2004-??-?? Michael Lauer <mickey@Vanille.de>
2 2
3 * Added command line option "-nocheck" to skip non-root and dhcp tests
3 * Improved the speed reading the manufacturer list 4 * Improved the speed reading the manufacturer list
4 * GPS coordinates are now presented in the DMS (as opposed to decimal) format 5 * GPS coordinates are now presented in the DMS (as opposed to decimal) format
5 6
diff --git a/noncore/net/wellenreiter/gui/main.cpp b/noncore/net/wellenreiter/gui/main.cpp
index 55a5260..dd757b5 100644
--- a/noncore/net/wellenreiter/gui/main.cpp
+++ b/noncore/net/wellenreiter/gui/main.cpp
@@ -52,7 +52,21 @@ int main( int argc, char **argv )
52 52
53 a.processEvents(); // show the window before doing the safety checks 53 a.processEvents(); // show the window before doing the safety checks
54 int result = -1; 54 int result = -1;
55 static int killed = false;
55 56
57 bool check = true;
58 for ( int i = 1; i < argc; ++i )
59 {
60 if ( !strcmp( "-nocheck", argv[i] ) )
61 {
62 qDebug( "-nocheck found" );
63 check = false;
64 break;
65 }
66 }
67
68 if ( check )
69 {
56 // root check 70 // root check
57 if ( getuid() ) 71 if ( getuid() )
58 { 72 {
@@ -66,8 +80,6 @@ int main( int argc, char **argv )
66 // dhcp check - NOT HERE! This really belongs as a static member to OProcess 80 // dhcp check - NOT HERE! This really belongs as a static member to OProcess
67 // and I want to call it like that: if ( OProcess::isRunning( QString& ) ) ... 81 // and I want to call it like that: if ( OProcess::isRunning( QString& ) ) ...
68 82
69 static int killed = false;
70
71 QString line; 83 QString line;
72 QDir d = QDir( "/proc" ); 84 QDir d = QDir( "/proc" );
73 QStringList dirs = d.entryList( QDir::Dirs ); 85 QStringList dirs = d.entryList( QDir::Dirs );
@@ -97,9 +109,13 @@ int main( int argc, char **argv )
97 killed = true; 109 killed = true;
98 } 110 }
99 } 111 }
112 }
100 113
101 a.exec(); 114 a.exec();
102 115
116 if ( check )
117 {
118
103 if ( killed ) 119 if ( killed )
104 { 120 {
105 result = QMessageBox::warning( w, " - Wellenreiter II - (dhcp)", QObject::tr( "Restart your dhcp client?" ), QMessageBox::Yes, QMessageBox::No ); 121 result = QMessageBox::warning( w, " - Wellenreiter II - (dhcp)", QObject::tr( "Restart your dhcp client?" ), QMessageBox::Yes, QMessageBox::No );
@@ -110,5 +126,6 @@ int main( int argc, char **argv )
110 } 126 }
111 127
112 delete w; 128 delete w;
129 }
113 return 0; 130 return 0;
114} 131}