Diffstat (limited to 'noncore/settings/networksettings2/profile/profilerun.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/profile/profilerun.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/noncore/settings/networksettings2/profile/profilerun.cpp b/noncore/settings/networksettings2/profile/profilerun.cpp index 90c37ed..feebf86 100644 --- a/noncore/settings/networksettings2/profile/profilerun.cpp +++ b/noncore/settings/networksettings2/profile/profilerun.cpp @@ -21,2 +21,3 @@ bool ProfileRun::setState( NodeCollection * NC, Action_t A ) { if( NC->currentState() == Disabled ) { + Data->Disabled = 0; NC->setCurrentState( Off ); // at least @@ -24,3 +25,2 @@ bool ProfileRun::setState( NodeCollection * NC, Action_t A ) { NNNI->runtime()->detectState(NC); - return 1; } @@ -28,14 +28,12 @@ bool ProfileRun::setState( NodeCollection * NC, Action_t A ) { case Disable : - if( NC->currentState() == IsUp ) { - // bring down -> make available - NNNI->runtime()->setState(NC, Down); - } - if( NC->currentState() == Available ) { - // make unavailable - NNNI->runtime()->setState(NC, Deactivate); - } - if( NC->currentState() > Available ) { - // could not disable - return 0; + switch( NC->currentState() ) { + case IsUp : + case Available : + // bring Deactivate (will bring down) + if( ! NNNI->runtime()->setState(NC, Deactivate) ) + return 0; + default : + break; } + Data->Disabled = 1; NC->setCurrentState( Disabled ); |