author | mickeyl <mickeyl> | 2004-01-05 23:37:19 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-01-05 23:37:19 (UTC) |
commit | 4b272b07b86e4dce14ab71054a3741fa9ad33572 (patch) (side-by-side diff) | |
tree | 381bf51d8e3258cbd15d36815b13dcfcac33845c | |
parent | fa6a2e24a70be69724387355970814c0fb63701d (diff) | |
download | opie-4b272b07b86e4dce14ab71054a3741fa9ad33572.zip opie-4b272b07b86e4dce14ab71054a3741fa9ad33572.tar.gz opie-4b272b07b86e4dce14ab71054a3741fa9ad33572.tar.bz2 |
add -nocheck command line option
-rw-r--r-- | noncore/net/wellenreiter/ChangeLog | 1 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/main.cpp | 21 |
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,6 +1,7 @@ 2004-??-?? Michael Lauer <mickey@Vanille.de> + * Added command line option "-nocheck" to skip non-root and dhcp tests * Improved the speed reading the manufacturer list * GPS coordinates are now presented in the DMS (as opposed to decimal) format 2003-12-18 Michael Lauer <mickey@Vanille.de> 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 @@ -51,9 +51,23 @@ int main( int argc, char **argv ) #endif a.processEvents(); // show the window before doing the safety checks int result = -1; + static int killed = false; + bool check = true; + for ( int i = 1; i < argc; ++i ) + { + if ( !strcmp( "-nocheck", argv[i] ) ) + { + qDebug( "-nocheck found" ); + check = false; + break; + } + } + + if ( check ) + { // root check if ( getuid() ) { qWarning( QObject::tr( "Wellenreiter: trying to run as non-root!" ) ); @@ -65,10 +79,8 @@ int main( int argc, char **argv ) // dhcp check - NOT HERE! This really belongs as a static member to OProcess // and I want to call it like that: if ( OProcess::isRunning( QString& ) ) ... - static int killed = false; - QString line; QDir d = QDir( "/proc" ); QStringList dirs = d.entryList( QDir::Dirs ); QStringList::Iterator it; @@ -96,11 +108,15 @@ int main( int argc, char **argv ) else killed = true; } } + } a.exec(); + if ( check ) + { + if ( killed ) { result = QMessageBox::warning( w, " - Wellenreiter II - (dhcp)", QObject::tr( "Restart your dhcp client?" ), QMessageBox::Yes, QMessageBox::No ); if ( result == QMessageBox::Yes ) @@ -109,6 +125,7 @@ int main( int argc, char **argv ) } } delete w; + } return 0; } |