Diffstat (limited to 'noncore/settings/networksettings2/network/network_NNI.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/network/network_NNI.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/noncore/settings/networksettings2/network/network_NNI.cpp b/noncore/settings/networksettings2/network/network_NNI.cpp index 34dac54..c183d5e 100644 --- a/noncore/settings/networksettings2/network/network_NNI.cpp +++ b/noncore/settings/networksettings2/network/network_NNI.cpp @@ -96,83 +96,83 @@ QString ANetwork::acceptable( void ) { void ANetwork::commit( void ) { if( GUI && GUI->commit( Data ) ) setModified( 1 ); } bool ANetwork::hasDataForFile( SystemFile & S ) { return S.name() == "interfaces"; } short ANetwork::generateFile( SystemFile &SF, long DevNr ) { short rvl, rvd ; QString NIC = runtime()->device()->netNode()->nodeClass()->genNic( DevNr ); rvl = 1; if( SF.name() == "interfaces" ) { Log(("Generate Network for %s\n", SF.name().latin1() )); // we can safely call from here since device item is deeper if( Data.UseDHCP ) { SF << "iface " << "A" - << connection()->number() + << networkSetup()->number() << NIC << " inet dhcp" << endl; SF << " up echo \"" << NIC << "\" > /tmp/profile-" - << connection()->number() + << networkSetup()->number() << ".up" << endl; if( Data.SendHostname ) { SF << " hostname " << Data.Hostname << endl; } SF << " down rm -f /tmp/profile-" - << connection()->number() + << networkSetup()->number() << ".up" << endl; } else { SF << "iface " << "A" - << connection()->number() + << networkSetup()->number() << NIC << " inet static" << endl; SF << " up echo \"" << NIC << "\" > /tmp/profile-" - << connection()->number() + << networkSetup()->number() << ".up" << endl; SF << " down rm -f /tmp/profile-" - << connection()->number() + << networkSetup()->number() << ".up" << endl; SF << " address " << Data.IPAddress << endl; SF << " broadcast " << Data.Broadcast << endl; SF << " netmask " << Data.NetMask << endl; // derive network address = IPAddress & netmask { QString NW; QStringList ipal = QStringList::split( '.', Data.IPAddress ); QStringList nmal = QStringList::split( '.', Data.NetMask ); NW = QString( "%1.%2.%3.%4" ). arg( ipal[0].toShort() & nmal[0].toShort() ). arg( ipal[1].toShort() & nmal[1].toShort() ). arg( ipal[2].toShort() & nmal[2].toShort() ). arg( ipal[3].toShort() & nmal[3].toShort() ); SF << " network " << NW @@ -190,29 +190,29 @@ short ANetwork::generateFile( SystemFile &SF, it != Data.PostUp_SL.end(); ++it ) { SF << " up " << (*it) << endl; } for ( QStringList::Iterator it = Data.PreDown_SL.begin(); it != Data.PreDown_SL.end(); ++it ) { SF << " down " << (*it) << endl; } for ( QStringList::Iterator it = Data.PostDown_SL.begin(); it != Data.PostDown_SL.end(); ++it ) { SF << " post-down " << (*it) << endl; } rvl = 0; } // embed other info in it - rvd = connection()->getToplevel()->generateFileEmbedded( SF, DevNr ); + rvd = networkSetup()->getToplevel()->generateFileEmbedded( SF, DevNr ); return (rvd == 2 || rvl == 2 ) ? 2 : (rvd == 0 || rvl == 0 ) ? 0 : 1; } |