summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/profile
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/profile') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/profile/profile_NN.cpp9
-rw-r--r--noncore/settings/networksettings2/profile/profile_NN.h4
-rw-r--r--noncore/settings/networksettings2/profile/profilerun.cpp22
-rw-r--r--noncore/settings/networksettings2/profile/profilerun.h3
4 files changed, 24 insertions, 14 deletions
diff --git a/noncore/settings/networksettings2/profile/profile_NN.cpp b/noncore/settings/networksettings2/profile/profile_NN.cpp
index c39b86f..fcf1ca6 100644
--- a/noncore/settings/networksettings2/profile/profile_NN.cpp
+++ b/noncore/settings/networksettings2/profile/profile_NN.cpp
@@ -40,22 +40,29 @@ const char * ProfileNetNode::provides( void ) {
40 40
41bool ProfileNetNode::generateProperFilesFor( 41bool ProfileNetNode::generateProperFilesFor(
42 ANetNodeInstance * ) { 42 ANetNodeInstance * ) {
43 return 1; 43 return 1;
44} 44}
45 45
46bool ProfileNetNode::hasDataFor( const QString & ) { 46bool ProfileNetNode::hasDataFor( const QString &, bool ) {
47 return 0; 47 return 0;
48} 48}
49 49
50bool ProfileNetNode::generateDataForCommonFile( 50bool ProfileNetNode::generateDataForCommonFile(
51 SystemFile & , 51 SystemFile & ,
52 long, 52 long,
53 ANetNodeInstance * ) { 53 ANetNodeInstance * ) {
54 return 1; 54 return 1;
55} 55}
56 56
57bool ProfileNetNode::generateDeviceDataForCommonFile(
58 SystemFile & ,
59 long ,
60 ANetNodeInstance * ) {
61 return 1;
62}
63
57extern "C" { 64extern "C" {
58void create_plugin( QList<ANetNode> & PNN ) { 65void create_plugin( QList<ANetNode> & PNN ) {
59 PNN.append( new ProfileNetNode() ); 66 PNN.append( new ProfileNetNode() );
60} 67}
61} 68}
diff --git a/noncore/settings/networksettings2/profile/profile_NN.h b/noncore/settings/networksettings2/profile/profile_NN.h
index 3c06947..b64a6dd 100644
--- a/noncore/settings/networksettings2/profile/profile_NN.h
+++ b/noncore/settings/networksettings2/profile/profile_NN.h
@@ -25,15 +25,17 @@ public:
25 virtual ANetNodeInstance * createInstance( void ); 25 virtual ANetNodeInstance * createInstance( void );
26 26
27 virtual const char ** needs( void ); 27 virtual const char ** needs( void );
28 virtual const char * provides( void ); 28 virtual const char * provides( void );
29 29
30 virtual bool generateProperFilesFor( ANetNodeInstance * NNI ); 30 virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
31 virtual bool hasDataFor( const QString & S ); 31 virtual bool hasDataFor( const QString & S, bool DS );
32 virtual bool generateDataForCommonFile( 32 virtual bool generateDataForCommonFile(
33 SystemFile & SF, long DevNr, ANetNodeInstance * NNI ); 33 SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
34 virtual bool generateDeviceDataForCommonFile(
35 SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
34 36
35private: 37private:
36 38
37}; 39};
38 40
39extern "C" 41extern "C"
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
@@ -16,31 +16,29 @@ bool ProfileRun::setState( NodeCollection * NC, Action_t A ) {
16 ANetNodeInstance * NNNI; 16 ANetNodeInstance * NNNI;
17 17
18 NNNI = netNode()->nextNode(); 18 NNNI = netNode()->nextNode();
19 switch ( A ) { 19 switch ( A ) {
20 case Enable : 20 case Enable :
21 if( NC->currentState() == Disabled ) { 21 if( NC->currentState() == Disabled ) {
22 Data->Disabled = 0;
22 NC->setCurrentState( Off ); // at least 23 NC->setCurrentState( Off ); // at least
23 // ... but request deeper 24 // ... but request deeper
24 NNNI->runtime()->detectState(NC); 25 NNNI->runtime()->detectState(NC);
25 return 1;
26 } 26 }
27 return 1; 27 return 1;
28 case Disable : 28 case Disable :
29 if( NC->currentState() == IsUp ) { 29 switch( NC->currentState() ) {
30 // bring down -> make available 30 case IsUp :
31 NNNI->runtime()->setState(NC, Down); 31 case Available :
32 } 32 // bring Deactivate (will bring down)
33 if( NC->currentState() == Available ) { 33 if( ! NNNI->runtime()->setState(NC, Deactivate) )
34 // make unavailable 34 return 0;
35 NNNI->runtime()->setState(NC, Deactivate); 35 default :
36 } 36 break;
37 if( NC->currentState() > Available ) {
38 // could not disable
39 return 0;
40 } 37 }
38 Data->Disabled = 1;
41 NC->setCurrentState( Disabled ); 39 NC->setCurrentState( Disabled );
42 return 1; 40 return 1;
43 default : 41 default :
44 break; 42 break;
45 } 43 }
46 return NNNI->runtime()->setState(NC, A); 44 return NNNI->runtime()->setState(NC, A);
diff --git a/noncore/settings/networksettings2/profile/profilerun.h b/noncore/settings/networksettings2/profile/profilerun.h
index d3797b5..6e8385c 100644
--- a/noncore/settings/networksettings2/profile/profilerun.h
+++ b/noncore/settings/networksettings2/profile/profilerun.h
@@ -17,12 +17,15 @@ public :
17 bool canSetState( State_t Curr, Action_t A ); 17 bool canSetState( State_t Curr, Action_t A );
18 18
19 bool handlesInterface( const QString & I ); 19 bool handlesInterface( const QString & I );
20 20
21 virtual const QString & description( void ) 21 virtual const QString & description( void )
22 { return Data->Description; } 22 { return Data->Description; }
23
24 virtual AsFullSetup * asFullSetup( void )
25 { return (AsFullSetup *)this; }
23private : 26private :
24 27
25 ProfileData * Data; 28 ProfileData * Data;
26 29
27}; 30};
28#endif 31#endif