Diffstat (limited to 'noncore/settings/networksettings2/wlan') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/wlan/wlan_NN.cpp | 13 | ||||
-rw-r--r-- | noncore/settings/networksettings2/wlan/wlan_NN.h | 8 |
2 files changed, 20 insertions, 1 deletions
diff --git a/noncore/settings/networksettings2/wlan/wlan_NN.cpp b/noncore/settings/networksettings2/wlan/wlan_NN.cpp index 4e59ac1..e0c4db2 100644 --- a/noncore/settings/networksettings2/wlan/wlan_NN.cpp +++ b/noncore/settings/networksettings2/wlan/wlan_NN.cpp | |||
@@ -6,12 +6,13 @@ static const char * WLanNeeds[] = | |||
6 | }; | 6 | }; |
7 | 7 | ||
8 | /** | 8 | /** |
9 | * Constructor, find all of the possible interfaces | 9 | * Constructor, find all of the possible interfaces |
10 | */ | 10 | */ |
11 | WLanNetNode::WLanNetNode() : ANetNode() { | 11 | WLanNetNode::WLanNetNode() : ANetNode() { |
12 | InstanceCount = 2; | ||
12 | } | 13 | } |
13 | 14 | ||
14 | /** | 15 | /** |
15 | * Delete any interfaces that we own. | 16 | * Delete any interfaces that we own. |
16 | */ | 17 | */ |
17 | WLanNetNode::~WLanNetNode(){ | 18 | WLanNetNode::~WLanNetNode(){ |
@@ -62,11 +63,23 @@ bool WLanNetNode::generateDeviceDataForCommonFile( | |||
62 | 63 | ||
63 | QString WLanNetNode::genNic( long nr ) { | 64 | QString WLanNetNode::genNic( long nr ) { |
64 | QString S; | 65 | QString S; |
65 | return S.sprintf( "wlan%ld", nr ); | 66 | return S.sprintf( "wlan%ld", nr ); |
66 | } | 67 | } |
67 | 68 | ||
69 | void WLanNetNode::setSpecificAttribute( QString & A, QString & V ) { | ||
70 | if( A == "interfacecount" ) { | ||
71 | InstanceCount = V.toLong(); | ||
72 | } | ||
73 | } | ||
74 | |||
75 | void WLanNetNode::saveSpecificAttribute( QTextStream & TS ) { | ||
76 | TS << "interfacecount=" | ||
77 | << InstanceCount | ||
78 | << endl; | ||
79 | } | ||
80 | |||
68 | extern "C" { | 81 | extern "C" { |
69 | void create_plugin( QList<ANetNode> & PNN ) { | 82 | void create_plugin( QList<ANetNode> & PNN ) { |
70 | PNN.append( new WLanNetNode() ); | 83 | PNN.append( new WLanNetNode() ); |
71 | } | 84 | } |
72 | } | 85 | } |
diff --git a/noncore/settings/networksettings2/wlan/wlan_NN.h b/noncore/settings/networksettings2/wlan/wlan_NN.h index f27e71c..e93a89a 100644 --- a/noncore/settings/networksettings2/wlan/wlan_NN.h +++ b/noncore/settings/networksettings2/wlan/wlan_NN.h | |||
@@ -31,18 +31,24 @@ public: | |||
31 | 31 | ||
32 | virtual bool hasDataFor( const QString & S ); | 32 | virtual bool hasDataFor( const QString & S ); |
33 | virtual bool generateDeviceDataForCommonFile( | 33 | virtual bool generateDeviceDataForCommonFile( |
34 | SystemFile & SF, long DevNr ); | 34 | SystemFile & SF, long DevNr ); |
35 | 35 | ||
36 | virtual long instanceCount( void ) | 36 | virtual long instanceCount( void ) |
37 | { return 2; } | 37 | { return InstanceCount; } |
38 | 38 | ||
39 | virtual QString genNic( long ); | 39 | virtual QString genNic( long ); |
40 | 40 | ||
41 | private: | 41 | private: |
42 | 42 | ||
43 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); | ||
44 | virtual void saveSpecificAttribute( QTextStream & TS ); | ||
45 | |||
46 | // number of interfaces for this device | ||
47 | long InstanceCount; | ||
48 | |||
43 | }; | 49 | }; |
44 | 50 | ||
45 | extern "C" | 51 | extern "C" |
46 | { | 52 | { |
47 | void create_plugin( QList<ANetNode> & PNN ); | 53 | void create_plugin( QList<ANetNode> & PNN ); |
48 | }; | 54 | }; |