Diffstat (limited to 'noncore/settings/networksettings2/lancard') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/lancard/lancardrun.cpp | 8 | ||||
-rw-r--r-- | noncore/settings/networksettings2/lancard/lancardrun.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/noncore/settings/networksettings2/lancard/lancardrun.cpp b/noncore/settings/networksettings2/lancard/lancardrun.cpp index 8157dce..8a71aa9 100644 --- a/noncore/settings/networksettings2/lancard/lancardrun.cpp +++ b/noncore/settings/networksettings2/lancard/lancardrun.cpp @@ -1,29 +1,29 @@ #include <qfile.h> #include <qtextstream.h> #include <qstringlist.h> #include <resources.h> #include "lancardrun.h" State_t LanCardRun::detectState( void ) { // unavailable : no card found // available : card found and assigned to us or free // up : card found and assigned to us and up - NodeCollection * NC = nodeCollection(); + NetworkSetup * NC = networkSetup(); QString S = QString( "/tmp/profile-%1.up" ). arg( NC->number()); System & Sys = NSResources->system(); InterfaceInfo * Run; QFile F( S ); if( F.open( IO_ReadOnly ) ) { // could open file -> read interface and assign QString X; QTextStream TS(&F); X = TS.readLine(); // find interface if( handlesInterface( X ) ) { for( QDictIterator<InterfaceInfo> It(Sys.interfaces()); It.current(); @@ -57,33 +57,33 @@ State_t LanCardRun::detectState( void ) { ( Run->CardType == ARPHRD_ETHER #ifdef ARPHRD_IEEE1394 || Run->CardType == ARPHRD_IEEE1394 #endif ) && ! Run->IsUp ) { // proper type, and Not UP -> free return Off; } } // no free found return Unavailable; } -QString LanCardRun::setMyState( NodeCollection * NC, Action_t A, bool ) { +QString LanCardRun::setMyState( NetworkSetup * NC, Action_t A, bool ) { if( A == Activate ) { InterfaceInfo * N = getInterface(); if( ! N ) { // no interface available NC->setCurrentState( Unavailable ); return tr("No interface found"); } // because we were OFF the interface // we get back is NOT assigned NC->assignInterface( N ); NC->setCurrentState( Available ); return QString(); } @@ -101,36 +101,36 @@ InterfaceInfo * LanCardRun::getInterface( void ) { System & S = NSResources->system(); InterfaceInfo * best = 0, * Run; for( QDictIterator<InterfaceInfo> It(S.interfaces()); It.current(); ++It ) { Run = It.current(); if( handlesInterface( *Run ) && ( Run->CardType == ARPHRD_ETHER #ifdef ARPHRD_IEEE1394 || Run->CardType == ARPHRD_IEEE1394 #endif ) ) { // this is a LAN card - if( Run->assignedConnection() == netNode()->connection() ) { + if( Run->assignedToNetworkSetup() == netNode()->networkSetup() ) { // assigned to us return Run; - } else if( Run->assignedConnection() == 0 ) { + } else if( Run->assignedToNetworkSetup() == 0 ) { // free best = Run; } } } return best; // can be 0 } bool LanCardRun::handlesInterface( const QString & S ) { InterfaceInfo * II; II = NSResources->system().interface( S ); if( ( II = NSResources->system().interface( S ) ) ) { return handlesInterface( *II ); } return Pat.match( S ) >= 0; } diff --git a/noncore/settings/networksettings2/lancard/lancardrun.h b/noncore/settings/networksettings2/lancard/lancardrun.h index 57ef3fb..dfd3d62 100644 --- a/noncore/settings/networksettings2/lancard/lancardrun.h +++ b/noncore/settings/networksettings2/lancard/lancardrun.h @@ -12,26 +12,26 @@ public : LanCardRun( ANetNodeInstance * NNI, LanCardData & D ) : RuntimeInfo( NNI ), Pat( "eth[0-9]" ) { Data = &D; } virtual RuntimeInfo * device( void ) { return this; } bool handlesInterface( const QString & I ); bool handlesInterface( const InterfaceInfo & II ); State_t detectState( void ); protected : - QString setMyState( NodeCollection * , Action_t, bool ); + QString setMyState( NetworkSetup * , Action_t, bool ); private : InterfaceInfo * getInterface( void ); QRegExp Pat; LanCardData * Data; }; #endif |