author | wimpie <wimpie> | 2004-08-09 02:31:25 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2004-08-09 02:31:25 (UTC) |
commit | 0784cfdbd261c43856b45be6ab7439841e69b858 (patch) (side-by-side diff) | |
tree | f6a27d6b2e1e6d8dcc908b2ef5836cd320ddfab1 /noncore/settings/networksettings2/nsdata.cpp | |
parent | 5e10278e748608766245ff9f59a54d1ae8ff6f7e (diff) | |
download | opie-0784cfdbd261c43856b45be6ab7439841e69b858.zip opie-0784cfdbd261c43856b45be6ab7439841e69b858.tar.gz opie-0784cfdbd261c43856b45be6ab7439841e69b858.tar.bz2 |
Many changes :
bluetooth and usb seems to work
added preliminary support for VPN on top of any network
This version is still very much crippled yet is does DO some
things
Diffstat (limited to 'noncore/settings/networksettings2/nsdata.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/nsdata.cpp | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/noncore/settings/networksettings2/nsdata.cpp b/noncore/settings/networksettings2/nsdata.cpp index bb37f10..3b17548 100644 --- a/noncore/settings/networksettings2/nsdata.cpp +++ b/noncore/settings/networksettings2/nsdata.cpp @@ -16,9 +16,9 @@ NetworkSettingsData::NetworkSettingsData( void ) { new TheNSResources(); CfgFile.sprintf( "%s/Settings/NS2.conf", NSResources->currentUser().HomeDir.latin1() ); - fprintf( stderr, "Cfg from %s\n", CfgFile.latin1() ); + Log(( "Cfg from %s\n", CfgFile.latin1() )); // load settings Force = 0; IsModified = 0; @@ -78,13 +78,13 @@ void NetworkSettingsData::loadSettings( void ) { S = S.mid( 9, S.length()-9 ); S = deQuote(S); // try to find netnode NN = NSResources->findNetNode( S ); - fprintf( stderr, "Node %s : %p\n", S.latin1(), NN ); + Log( ( "Node %s : %p\n", S.latin1(), NN ) ); } else { // try to find instance NNI = NSResources->createNodeInstance( S ); - fprintf( stderr, "NodeInstance %s : %p\n", S.latin1(), NNI ); + Log( ( "NodeInstance %s : %p\n", S.latin1(), NNI )); } if( NN == 0 && NNI == 0 ) { LeftOvers.append( Line ); @@ -150,9 +150,9 @@ QString NetworkSettingsData::saveSettings( void ) { QString S; QFile F( CfgFile + ".bup" ); - printf( "Saving settings to %s\n", CfgFile.latin1() ); + Log( ( "Saving settings to %s\n", CfgFile.latin1() )); if( ! F.open( IO_WriteOnly | IO_Truncate ) ) { ErrS = qApp->translate( "NetworkSettings", "<p>Could not save setup to \"%1\" !</p>" ). arg(CfgFile); @@ -228,9 +228,9 @@ QString NetworkSettingsData::generateSettings( bool ForceReq ) { if( ! ForceIt && ! isModified() ) return S; // regenerate system files - fprintf( stderr, "Generating settings from %s\n", CfgFile.latin1() ); + Log( ( "Generating settings from %s\n", CfgFile.latin1() )); { Name2SystemFile_t & SFM = NSResources->systemFiles(); Name2Connection_t & M = NSResources->connections(); NodeCollection * NC; @@ -280,16 +280,8 @@ QString NetworkSettingsData::generateSettings( bool ForceReq ) { break; } } - // we cannot renumber with a FORCE request since - // we probably are NOT going to save the config - // e.g. when using --regen option - if( ! ForceReq && needToRegenerate ) { - NSResources->renumberConnections(); - setModified(1); - } - // // generate files proper to each netnodeinstance // { Name2Instance_t & NNIs = NSResources->netNodeInstances(); @@ -320,9 +312,9 @@ QString NetworkSettingsData::generateSettings( bool ForceReq ) { sfit.current(); ++sfit ) { SF = sfit.current(); - fprintf( stderr, "Generating %s\n", SF->name().latin1() ); + Log( ( "Generating %s\n", SF->name().latin1() )); SF->open(); do { // so we can break; @@ -404,9 +396,9 @@ QList<NodeCollection> NetworkSettingsData::collectPossible( const char * Interfa if( NC->handlesInterface( Interface ) && // if different Intf. NC->state() != Disabled && // if not enabled NC->state() != IsUp // if already used ) { - fprintf( stderr, "Append %s for %s\n", NC->name().latin1(), Interface); + Log( ( "Append %s for %s\n", NC->name().latin1(), Interface)); PossibleConnections.append( NC ); } } return PossibleConnections; @@ -425,10 +417,9 @@ bool NetworkSettingsData::canStart( const char * Interface ) { QList<NodeCollection> PossibleConnections; PossibleConnections = collectPossible( Interface ); - fprintf( stderr, "Possiblilies %d\n", - PossibleConnections.count() ); + Log( ( "Possiblilies %d\n", PossibleConnections.count() )); switch( PossibleConnections.count() ) { case 0 : // no connections break; case 1 : // one connection |