Diffstat (limited to 'noncore/settings/networksettings2/nsdata.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/nsdata.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/noncore/settings/networksettings2/nsdata.cpp b/noncore/settings/networksettings2/nsdata.cpp index eb63e02..b4d9aaa 100644 --- a/noncore/settings/networksettings2/nsdata.cpp +++ b/noncore/settings/networksettings2/nsdata.cpp @@ -16,5 +16,7 @@ NetworkSettingsData::NetworkSettingsData( void ) { new TheNSResources(); - CfgFile.sprintf( "%s/NETCONFIG", getenv("HOME") ); + CfgFile.sprintf( "%s/NETCONFIG", + NSResources->currentUser().HomeDir.latin1() ); + fprintf( stderr, "Cfg from %s\n", CfgFile.latin1() ); // load settings @@ -354,8 +356,10 @@ QList<NodeCollection> NetworkSettingsData::collectPossible( const char * Interfa NC = it.current(); // check if this profile handles the requested interface + fprintf( stderr, "check %s\n", NC->name().latin1() ); if( NC->handlesInterface( Interface ) && // if different Intf. NC->state() != Disabled && // if not enabled NC->state() != IsUp // if already used ) { + fprintf( stderr, "Append %s\n", NC->name().latin1() ); PossibleConnections.append( NC ); } @@ -371,5 +375,5 @@ QList<NodeCollection> NetworkSettingsData::collectPossible( const char * Interfa */ -void NetworkSettingsData::canStart( const char * Interface ) { +bool NetworkSettingsData::canStart( const char * Interface ) { // load situation NodeCollection * NC = 0; @@ -378,4 +382,6 @@ void NetworkSettingsData::canStart( const char * Interface ) { PossibleConnections = collectPossible( Interface ); + fprintf( stderr, "Possiblilies %d\n", + PossibleConnections.count() ); switch( PossibleConnections.count() ) { case 0 : // no connections @@ -385,8 +391,5 @@ void NetworkSettingsData::canStart( const char * Interface ) { break; default : // need to ask user ? - // are we connected to a server - // system( "su %d networksettings2 --prompt %s\n", - // "", Interface ); - break; + return 1; } @@ -411,10 +414,11 @@ void NetworkSettingsData::canStart( const char * Interface ) { // device is ready -> done printf( "%s-c%d-allowed\n", Interface, NC->number() ); - return; + return 0; } - } else { - // if we come here no alternatives are possible - printf( "%s-cnn-disallowed\n", Interface ); - } + } + + // if we come here no alternatives are possible + printf( "%s-cnn-disallowed\n", Interface ); + return 0; } |