summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/wlan/wlan_NN.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/networksettings2/wlan/wlan_NN.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/wlan/wlan_NN.cpp29
1 files changed, 17 insertions, 12 deletions
diff --git a/noncore/settings/networksettings2/wlan/wlan_NN.cpp b/noncore/settings/networksettings2/wlan/wlan_NN.cpp
index e1e20c0..4e59ac1 100644
--- a/noncore/settings/networksettings2/wlan/wlan_NN.cpp
+++ b/noncore/settings/networksettings2/wlan/wlan_NN.cpp
@@ -39,28 +39,33 @@ const char * WLanNetNode::provides( void ) {
bool WLanNetNode::generateProperFilesFor(
ANetNodeInstance * ) {
return 1;
}
-bool WLanNetNode::hasDataFor( const QString & S, bool DS ) {
- return DS && S == "interfaces";
-}
-
-bool WLanNetNode::generateDataForCommonFile(
- SystemFile &,
- long ,
- ANetNodeInstance * ) {
- return 1;
+bool WLanNetNode::hasDataFor( const QString & S ) {
+ return S == "interfaces";
}
bool WLanNetNode::generateDeviceDataForCommonFile(
SystemFile & S,
- long DevNr,
- ANetNodeInstance * NNI ) {
- return ((AWLan *)NNI)->generateDeviceDataForCommonFile(S, DevNr);
+ long DevNr ) {
+ QString NIC = genNic( DevNr );
+
+ if( S.name() == "interfaces" ) {
+ // generate mapping stanza for this interface
+ S << "# check if " << NIC << " can be brought UP" << endl;
+ S << "mapping " << NIC << endl;
+ S << " script networksettings2-request" << endl << endl;
+ }
+ return 0;
+}
+
+QString WLanNetNode::genNic( long nr ) {
+ QString S;
+ return S.sprintf( "wlan%ld", nr );
}
extern "C" {
void create_plugin( QList<ANetNode> & PNN ) {
PNN.append( new WLanNetNode() );
}