Diffstat (limited to 'noncore/settings/networksettings2/networksettings2/systemfile.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/networksettings2/systemfile.cpp | 49 |
1 files changed, 46 insertions, 3 deletions
diff --git a/noncore/settings/networksettings2/networksettings2/systemfile.cpp b/noncore/settings/networksettings2/networksettings2/systemfile.cpp index 7249976..394ff52 100644 --- a/noncore/settings/networksettings2/networksettings2/systemfile.cpp +++ b/noncore/settings/networksettings2/networksettings2/systemfile.cpp | |||
@@ -31,5 +31,7 @@ SystemFile::SystemFile( const QString & N, const QString & P ){ | |||
31 | hasPostSection = | 31 | hasPostSection = |
32 | hasPreNodeSection = | 32 | hasPreNodeSection = |
33 | hasPostNodeSection = 0; | 33 | hasPostNodeSection = |
34 | hasPreDeviceSection = | ||
35 | hasPostDeviceSection = 0; | ||
34 | return; | 36 | return; |
35 | } | 37 | } |
@@ -49,4 +51,10 @@ SystemFile::SystemFile( const QString & N, const QString & P ){ | |||
49 | FI.setFile( S ); | 51 | FI.setFile( S ); |
50 | hasPostNodeSection = ( FI.exists() && FI.isReadable() ); | 52 | hasPostNodeSection = ( FI.exists() && FI.isReadable() ); |
53 | S = TemplDir + Name + "/predevicesection"; | ||
54 | FI.setFile( S ); | ||
55 | hasPreDeviceSection = ( FI.exists() && FI.isReadable() ); | ||
56 | S = TemplDir + Name + "/postdevicesection"; | ||
57 | FI.setFile( S ); | ||
58 | hasPostDeviceSection = ( FI.exists() && FI.isReadable() ); | ||
51 | } | 59 | } |
52 | } | 60 | } |
@@ -109,5 +117,5 @@ bool SystemFile::postSection( void ) { | |||
109 | bool SystemFile::preNodeSection( ANetNodeInstance * NNI, long ) { | 117 | bool SystemFile::preNodeSection( ANetNodeInstance * NNI, long ) { |
110 | if( hasPreNodeSection ) { | 118 | if( hasPreNodeSection ) { |
111 | QFile Fl( TemplDir + Name + "/prenodesectoin" ); | 119 | QFile Fl( TemplDir + Name + "/prenodesection" ); |
112 | if( ! Fl.open( IO_ReadOnly ) ) | 120 | if( ! Fl.open( IO_ReadOnly ) ) |
113 | return 1; // error | 121 | return 1; // error |
@@ -127,5 +135,5 @@ bool SystemFile::preNodeSection( ANetNodeInstance * NNI, long ) { | |||
127 | bool SystemFile::postNodeSection( ANetNodeInstance * NNI, long DevNr ) { | 135 | bool SystemFile::postNodeSection( ANetNodeInstance * NNI, long DevNr ) { |
128 | if( hasPostNodeSection ) { | 136 | if( hasPostNodeSection ) { |
129 | QFile Fl( TemplDir + Name + "/postnodesectoin" ); | 137 | QFile Fl( TemplDir + Name + "/postnodesection" ); |
130 | if( ! Fl.open( IO_ReadOnly ) ) | 138 | if( ! Fl.open( IO_ReadOnly ) ) |
131 | return 1; // error | 139 | return 1; // error |
@@ -143,2 +151,37 @@ bool SystemFile::postNodeSection( ANetNodeInstance * NNI, long DevNr ) { | |||
143 | } | 151 | } |
144 | 152 | ||
153 | bool SystemFile::preDeviceSection( ANetNodeInstance * NNI, long ) { | ||
154 | if( hasPreDeviceSection ) { | ||
155 | QFile Fl( TemplDir + Name + "/predevicesection" ); | ||
156 | if( ! Fl.open( IO_ReadOnly ) ) | ||
157 | return 1; // error | ||
158 | QTextStream TX( &Fl ); | ||
159 | QString Out; | ||
160 | QString S = TX.readLine(); | ||
161 | while( ! TX.eof() ) { | ||
162 | Out = S. | ||
163 | arg(NNI->netNode()->nodeName()); | ||
164 | (*this) << Out << endl; | ||
165 | S = TX.readLine(); | ||
166 | } | ||
167 | } | ||
168 | return 0; | ||
169 | } | ||
170 | |||
171 | bool SystemFile::postDeviceSection( ANetNodeInstance * NNI, long DevNr ) { | ||
172 | if( hasPostDeviceSection ) { | ||
173 | QFile Fl( TemplDir + Name + "/postdevicesection" ); | ||
174 | if( ! Fl.open( IO_ReadOnly ) ) | ||
175 | return 1; // error | ||
176 | QTextStream TX( &Fl ); | ||
177 | QString Out; | ||
178 | QString S = TX.readLine(); | ||
179 | while( ! TX.eof() ) { | ||
180 | Out = S. | ||
181 | arg(NNI->nodeName()); | ||
182 | (*this) << Out << endl; | ||
183 | S = TX.readLine(); | ||
184 | } | ||
185 | } | ||
186 | return 0; | ||
187 | } | ||