author | wimpie <wimpie> | 2004-08-19 21:48:46 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2004-08-19 21:48:46 (UTC) |
commit | 45616f57d3871827a247c1962e7c88699d111002 (patch) (side-by-side diff) | |
tree | 7ad9cbe10eb624cb08a7a41944e59f0371547517 /noncore/settings/networksettings2/nsdata.cpp | |
parent | f58fb0a08321b6d8a9ce1bac2ce4b7eb67c27347 (diff) | |
download | opie-45616f57d3871827a247c1962e7c88699d111002.zip opie-45616f57d3871827a247c1962e7c88699d111002.tar.gz opie-45616f57d3871827a247c1962e7c88699d111002.tar.bz2 |
Network_NN.cpp : had to generate full path to networksettings since
ifup (when run from hotplug) does not know about QPEDIR ...
main.cpp : a bit more logging
nsdata.cpp resources : optimized user detection code, report error
when user could not be detected (instead of gracefull crash)
Diffstat (limited to 'noncore/settings/networksettings2/nsdata.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/nsdata.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/noncore/settings/networksettings2/nsdata.cpp b/noncore/settings/networksettings2/nsdata.cpp index d709c0a..e2dd5b5 100644 --- a/noncore/settings/networksettings2/nsdata.cpp +++ b/noncore/settings/networksettings2/nsdata.cpp @@ -12,12 +12,19 @@ static QString CfgFile; NetworkSettingsData::NetworkSettingsData( void ) { // init global resources structure new TheNSResources(); + if( ! NSResources->userKnown() ) { + Log(( "Cannot detect qpe user HOME=\"%s\" USER=\"%s\"\n", + NSResources->currentUser().HomeDir.latin1(), + NSResources->currentUser().UserName.latin1() )); + return; + } + CfgFile.sprintf( "%s/Settings/NS2.conf", NSResources->currentUser().HomeDir.latin1() ); Log(( "Cfg from %s\n", CfgFile.latin1() )); // load settings IsModified = 0; @@ -536,13 +543,14 @@ bool NetworkSettingsData::canStart( const char * Interface ) { // load situation NodeCollection * NC = 0; QList<NodeCollection> PossibleConnections; PossibleConnections = collectPossible( Interface ); - Log( ( "Possiblilies %d\n", PossibleConnections.count() )); + Log( ( "for %s : Possiblilies %d\n", + Interface, PossibleConnections.count() )); switch( PossibleConnections.count() ) { case 0 : // no connections break; case 1 : // one connection NC = PossibleConnections.first(); break; @@ -566,18 +574,20 @@ bool NetworkSettingsData::canStart( const char * Interface ) { break; } // FT case Available : case IsUp : // also called for 'ifdown' // device is ready -> done + Log(( "%s-c%d-allowed\n", Interface, NC->number() )); printf( "%s-c%d-allowed\n", Interface, NC->number() ); return 0; } } // if we come here no alternatives are possible + Log(( "%s-cnn-disallowed\n", Interface )); printf( "%s-cnn-disallowed\n", Interface ); return 0; } /* Called by the system to regenerate config files |