Diffstat (limited to 'noncore/settings/networksettings2/networksettings2/systemfile.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/networksettings2/systemfile.cpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/noncore/settings/networksettings2/networksettings2/systemfile.cpp b/noncore/settings/networksettings2/networksettings2/systemfile.cpp index b3fc1a5..2b40834 100644 --- a/noncore/settings/networksettings2/networksettings2/systemfile.cpp +++ b/noncore/settings/networksettings2/networksettings2/systemfile.cpp @@ -12,5 +12,7 @@ QString TemplDir; -SystemFile::SystemFile( const QString & N, const QString & P ){ +SystemFile::SystemFile( const QString & N, + const QString & P, + bool KDI ){ Name = N; Path = P; @@ -58,4 +60,6 @@ SystemFile::SystemFile( const QString & N, const QString & P ){ hasPostDeviceSection = ( FI.exists() && FI.isReadable() ); } + + KnowsDeviceInstances = KDI; } @@ -97,9 +101,9 @@ bool SystemFile::preSection( void ) { QFile Fl( TemplDir + Name + "/presection" ); if( ! Fl.open( IO_ReadOnly ) ) - return 1; // error + return 0; // error // copy file to this file F->writeBlock( Fl.readAll() ); } - return 0; + return 1; } @@ -108,9 +112,9 @@ bool SystemFile::postSection( void ) { QFile Fl( TemplDir + Name + "/postsection" ); if( ! Fl.open( IO_ReadOnly ) ) - return 1; // error + return 0; // error // copy file to this file F->writeBlock( Fl.readAll() ); } - return 0; + return 1; } @@ -119,5 +123,5 @@ bool SystemFile::preNodeSection( ANetNodeInstance * NNI, long ) { QFile Fl( TemplDir + Name + "/prenodesection" ); if( ! Fl.open( IO_ReadOnly ) ) - return 1; // error + return 0; // error QTextStream TX( &Fl ); QString Out; @@ -130,5 +134,5 @@ bool SystemFile::preNodeSection( ANetNodeInstance * NNI, long ) { } } - return 0; + return 1; } @@ -137,5 +141,5 @@ bool SystemFile::postNodeSection( ANetNodeInstance * NNI, long ) { QFile Fl( TemplDir + Name + "/postnodesection" ); if( ! Fl.open( IO_ReadOnly ) ) - return 1; // error + return 0; // error QTextStream TX( &Fl ); QString Out; @@ -148,5 +152,5 @@ bool SystemFile::postNodeSection( ANetNodeInstance * NNI, long ) { } } - return 0; + return 1; } @@ -155,5 +159,5 @@ bool SystemFile::preDeviceSection( ANetNode * NN ) { QFile Fl( TemplDir + Name + "/predevicesection" ); if( ! Fl.open( IO_ReadOnly ) ) - return 1; // error + return 0; // error QTextStream TX( &Fl ); QString Out; @@ -165,5 +169,5 @@ bool SystemFile::preDeviceSection( ANetNode * NN ) { } } - return 0; + return 1; } @@ -172,5 +176,5 @@ bool SystemFile::postDeviceSection( ANetNode * NN ) { QFile Fl( TemplDir + Name + "/postdevicesection" ); if( ! Fl.open( IO_ReadOnly ) ) - return 1; // error + return 0; // error QTextStream TX( &Fl ); QString Out; @@ -182,4 +186,4 @@ bool SystemFile::postDeviceSection( ANetNode * NN ) { } } - return 0; + return 1; } |