Diffstat (limited to 'noncore/settings/networksettings2/usb') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/usb/usb_NN.cpp | 24 | ||||
-rw-r--r-- | noncore/settings/networksettings2/usb/usb_NN.h | 8 | ||||
-rw-r--r-- | noncore/settings/networksettings2/usb/usb_NNI.cpp | 25 | ||||
-rw-r--r-- | noncore/settings/networksettings2/usb/usb_NNI.h | 5 | ||||
-rw-r--r-- | noncore/settings/networksettings2/usb/usbrun.cpp | 6 | ||||
-rw-r--r-- | noncore/settings/networksettings2/usb/usbrun.h | 4 |
6 files changed, 31 insertions, 41 deletions
diff --git a/noncore/settings/networksettings2/usb/usb_NN.cpp b/noncore/settings/networksettings2/usb/usb_NN.cpp index be4a2bc..30c72db 100644 --- a/noncore/settings/networksettings2/usb/usb_NN.cpp +++ b/noncore/settings/networksettings2/usb/usb_NN.cpp | |||
@@ -44,3 +44,3 @@ bool USBNetNode::generateProperFilesFor( | |||
44 | 44 | ||
45 | bool USBNetNode::hasDataFor( const QString & S, bool ) { | 45 | bool USBNetNode::hasDataFor( const QString & S ) { |
46 | return (S== "interfaces"); | 46 | return (S== "interfaces"); |
@@ -48,14 +48,18 @@ bool USBNetNode::hasDataFor( const QString & S, bool ) { | |||
48 | 48 | ||
49 | bool USBNetNode::generateDataForCommonFile( | 49 | bool USBNetNode::generateDeviceDataForCommonFile( |
50 | SystemFile & S , | 50 | SystemFile & S , |
51 | long DevNr, | 51 | long DevNr ) { |
52 | ANetNodeInstance * NNI) { | 52 | QString NIC = genNic( DevNr ); |
53 | return ((AUSB *)NNI)->generateDataForCommonFile(S, DevNr); | 53 | |
54 | if( S.name() == "interfaces" ) { | ||
55 | // generate mapping stanza for this interface | ||
56 | S << "# check if " << NIC << " can be brought UP" << endl; | ||
57 | S << "mapping " << NIC << endl; | ||
58 | S << " script networksettings2-request" << endl << endl; | ||
59 | } | ||
60 | return 0; | ||
54 | } | 61 | } |
55 | 62 | ||
56 | bool USBNetNode::generateDeviceDataForCommonFile( | 63 | QString USBNetNode::genNic( long ) { |
57 | SystemFile & S , | 64 | return QString( "usbf" ); |
58 | long DevNr, | ||
59 | ANetNodeInstance * NNI) { | ||
60 | return ((AUSB *)NNI)->generateDeviceDataForCommonFile(S, DevNr); | ||
61 | } | 65 | } |
diff --git a/noncore/settings/networksettings2/usb/usb_NN.h b/noncore/settings/networksettings2/usb/usb_NN.h index 8ff5289..ba22b1c 100644 --- a/noncore/settings/networksettings2/usb/usb_NN.h +++ b/noncore/settings/networksettings2/usb/usb_NN.h | |||
@@ -30,7 +30,7 @@ public: | |||
30 | virtual bool generateProperFilesFor( ANetNodeInstance * NNI ); | 30 | virtual bool generateProperFilesFor( ANetNodeInstance * NNI ); |
31 | virtual bool hasDataFor( const QString & S, bool DeviceSpec ); | 31 | virtual bool hasDataFor( const QString & S); |
32 | virtual bool generateDataForCommonFile( | ||
33 | SystemFile & SF, long DevNr, ANetNodeInstance * NNI ); | ||
34 | virtual bool generateDeviceDataForCommonFile( | 32 | virtual bool generateDeviceDataForCommonFile( |
35 | SystemFile & SF, long DevNr, ANetNodeInstance * NNI ); | 33 | SystemFile & SF, long DevNr ); |
34 | |||
35 | virtual QString genNic( long nr ); | ||
36 | 36 | ||
diff --git a/noncore/settings/networksettings2/usb/usb_NNI.cpp b/noncore/settings/networksettings2/usb/usb_NNI.cpp index 6fcd6d5..e90204c 100644 --- a/noncore/settings/networksettings2/usb/usb_NNI.cpp +++ b/noncore/settings/networksettings2/usb/usb_NNI.cpp | |||
@@ -34,16 +34,8 @@ void AUSB::commit( void ) { | |||
34 | 34 | ||
35 | bool AUSB::generateDataForCommonFile( SystemFile & S, long DevNr ) { | 35 | bool AUSB::hasDataFor( const QString & S ) { |
36 | AsDevice * Dev = runtime()->device(); | 36 | return (S== "interfaces"); |
37 | QString NIC = Dev->genNic( DevNr ); | ||
38 | |||
39 | if( S.name() == "interfaces" ) { | ||
40 | // generate mapping stanza for this interface | ||
41 | S << " pre-up " << QPEApplication::qpeDir() << "bin/setmacaddress.sh " << NIC << " || true" << endl; | ||
42 | } | ||
43 | return 0; | ||
44 | } | 37 | } |
45 | 38 | ||
46 | bool AUSB::generateDeviceDataForCommonFile( SystemFile & S, long DevNr ) { | 39 | bool AUSB::generateDataForCommonFile( SystemFile & S, long DevNr ) { |
47 | AsDevice * Dev = runtime()->device(); | 40 | QString NIC = runtime()->device()->netNode()->nodeClass()->genNic( DevNr ); |
48 | QString NIC = Dev->genNic( DevNr ); | ||
49 | 41 | ||
@@ -51,5 +43,8 @@ bool AUSB::generateDeviceDataForCommonFile( SystemFile & S, long DevNr ) { | |||
51 | // generate mapping stanza for this interface | 43 | // generate mapping stanza for this interface |
52 | S << "# check if " << NIC << " can be brought UP" << endl; | 44 | S << " pre-up " |
53 | S << "mapping " << NIC << endl; | 45 | << QPEApplication::qpeDir() |
54 | S << " script networksettings2-request" << endl << endl; | 46 | << "bin/setmacaddress.sh " |
47 | << NIC | ||
48 | << " || true" | ||
49 | << endl; | ||
55 | } | 50 | } |
diff --git a/noncore/settings/networksettings2/usb/usb_NNI.h b/noncore/settings/networksettings2/usb/usb_NNI.h index 5dead36..d2ee217 100644 --- a/noncore/settings/networksettings2/usb/usb_NNI.h +++ b/noncore/settings/networksettings2/usb/usb_NNI.h | |||
@@ -29,4 +29,5 @@ public : | |||
29 | 29 | ||
30 | bool generateDataForCommonFile( SystemFile & S, long DevNr ); | 30 | virtual bool hasDataFor( const QString & S); |
31 | bool generateDeviceDataForCommonFile( SystemFile & S, long DevNr ); | 31 | virtual bool generateDataForCommonFile( |
32 | SystemFile & SF, long DevNr ); | ||
32 | 33 | ||
diff --git a/noncore/settings/networksettings2/usb/usbrun.cpp b/noncore/settings/networksettings2/usb/usbrun.cpp index 3007e79..4ce6721 100644 --- a/noncore/settings/networksettings2/usb/usbrun.cpp +++ b/noncore/settings/networksettings2/usb/usbrun.cpp | |||
@@ -176,7 +176 @@ bool USBRun::handlesInterface( const QString & S ) { | |||
176 | |||
177 | QString USBRun::genNic( long nr ) { | ||
178 | QString S; | ||
179 | S.sprintf( "usbf" ); | ||
180 | return S; | ||
181 | } | ||
182 | |||
diff --git a/noncore/settings/networksettings2/usb/usbrun.h b/noncore/settings/networksettings2/usb/usbrun.h index 60f9fe8..6c6e4e4 100644 --- a/noncore/settings/networksettings2/usb/usbrun.h +++ b/noncore/settings/networksettings2/usb/usbrun.h | |||
@@ -17,6 +17,2 @@ public : | |||
17 | 17 | ||
18 | virtual long count( void ) | ||
19 | { return 1; } | ||
20 | virtual QString genNic( long nr ); | ||
21 | |||
22 | virtual AsDevice * device( void ) | 18 | virtual AsDevice * device( void ) |