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.cpp | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/noncore/settings/networksettings2/usb/usb_NNI.cpp b/noncore/settings/networksettings2/usb/usb_NNI.cpp index e90204c..50c6e8d 100644 --- a/noncore/settings/networksettings2/usb/usb_NNI.cpp +++ b/noncore/settings/networksettings2/usb/usb_NNI.cpp @@ -19,34 +19,43 @@ void AUSB::saveSpecificAttribute( QTextStream & ) { QWidget * AUSB::edit( QWidget * parent ) { GUI = new USBEdit( parent ); GUI->showData( Data ); return GUI; } QString AUSB::acceptable( void ) { return ( GUI ) ? GUI->acceptable( ) : QString(); } void AUSB::commit( void ) { if( GUI && GUI->commit( Data ) ) { setModified( 1 ); } } -bool AUSB::hasDataFor( const QString & S ) { - return (S== "interfaces"); -} - -bool AUSB::generateDataForCommonFile( SystemFile & S, long DevNr ) { +short AUSB::generateFileEmbedded( const QString & ID, + const QString & Path, + QTextStream & TS, + long DevNr ) { + QString NIC = runtime()->device()->netNode()->nodeClass()->genNic( DevNr ); + short rvl, rvd; + + rvl = 1; - if( S.name() == "interfaces" ) { + if( ID == "interfaces" ) { + Log(("Generate USB for %s\n", ID.latin1() )); // generate mapping stanza for this interface - S << " pre-up " - << QPEApplication::qpeDir() - << "bin/setmacaddress.sh " - << NIC - << " || true" - << endl; + TS << " pre-up " + << QPEApplication::qpeDir() + << "bin/setmacaddress.sh " + << NIC + << " || true" + << endl; + rvl = 0; } - return 0; + rvd = ANetNodeInstance::generateFileEmbedded( ID, Path, TS, DevNr ); + + return (rvd == 2 || rvl == 2 ) ? 2 : + (rvd == 0 || rvl == 0 ) ? 0 : 1; + } |