summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/nsdata.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/nsdata.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/nsdata.cpp26
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 ) {
16 new TheNSResources(); 16 new TheNSResources();
17 17
18 CfgFile.sprintf( "%s/NETCONFIG", getenv("HOME") ); 18 CfgFile.sprintf( "%s/NETCONFIG",
19 NSResources->currentUser().HomeDir.latin1() );
20 fprintf( stderr, "Cfg from %s\n", CfgFile.latin1() );
19 21
20 // load settings 22 // load settings
@@ -354,8 +356,10 @@ QList<NodeCollection> NetworkSettingsData::collectPossible( const char * Interfa
354 NC = it.current(); 356 NC = it.current();
355 // check if this profile handles the requested interface 357 // check if this profile handles the requested interface
358 fprintf( stderr, "check %s\n", NC->name().latin1() );
356 if( NC->handlesInterface( Interface ) && // if different Intf. 359 if( NC->handlesInterface( Interface ) && // if different Intf.
357 NC->state() != Disabled && // if not enabled 360 NC->state() != Disabled && // if not enabled
358 NC->state() != IsUp // if already used 361 NC->state() != IsUp // if already used
359 ) { 362 ) {
363 fprintf( stderr, "Append %s\n", NC->name().latin1() );
360 PossibleConnections.append( NC ); 364 PossibleConnections.append( NC );
361 } 365 }
@@ -371,5 +375,5 @@ QList<NodeCollection> NetworkSettingsData::collectPossible( const char * Interfa
371*/ 375*/
372 376
373void NetworkSettingsData::canStart( const char * Interface ) { 377bool NetworkSettingsData::canStart( const char * Interface ) {
374 // load situation 378 // load situation
375 NodeCollection * NC = 0; 379 NodeCollection * NC = 0;
@@ -378,4 +382,6 @@ void NetworkSettingsData::canStart( const char * Interface ) {
378 PossibleConnections = collectPossible( Interface ); 382 PossibleConnections = collectPossible( Interface );
379 383
384 fprintf( stderr, "Possiblilies %d\n",
385 PossibleConnections.count() );
380 switch( PossibleConnections.count() ) { 386 switch( PossibleConnections.count() ) {
381 case 0 : // no connections 387 case 0 : // no connections
@@ -385,8 +391,5 @@ void NetworkSettingsData::canStart( const char * Interface ) {
385 break; 391 break;
386 default : // need to ask user ? 392 default : // need to ask user ?
387 // are we connected to a server 393 return 1;
388 // system( "su %d networksettings2 --prompt %s\n",
389 // "", Interface );
390 break;
391 } 394 }
392 395
@@ -411,10 +414,11 @@ void NetworkSettingsData::canStart( const char * Interface ) {
411 // device is ready -> done 414 // device is ready -> done
412 printf( "%s-c%d-allowed\n", Interface, NC->number() ); 415 printf( "%s-c%d-allowed\n", Interface, NC->number() );
413 return; 416 return 0;
414 } 417 }
415 } else { 418 }
416 // if we come here no alternatives are possible 419
417 printf( "%s-cnn-disallowed\n", Interface ); 420 // if we come here no alternatives are possible
418 } 421 printf( "%s-cnn-disallowed\n", Interface );
422 return 0;
419} 423}
420 424