summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/usb/usb_NNI.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/usb/usb_NNI.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/usb/usb_NNI.cpp25
1 files changed, 10 insertions, 15 deletions
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
@@ -29,29 +29,24 @@ QString AUSB::acceptable( void ) {
29void AUSB::commit( void ) { 29void AUSB::commit( void ) {
30 if( GUI && GUI->commit( Data ) ) { 30 if( GUI && GUI->commit( Data ) ) {
31 setModified( 1 ); 31 setModified( 1 );
32 } 32 }
33} 33}
34 34
35bool AUSB::generateDataForCommonFile( SystemFile & S, long DevNr ) { 35bool 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
46bool AUSB::generateDeviceDataForCommonFile( SystemFile & S, long DevNr ) { 39bool 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
50 if( S.name() == "interfaces" ) { 42 if( S.name() == "interfaces" ) {
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 }
56 return 0; 51 return 0;
57} 52}