Diffstat (limited to 'kabc/plugins/file/resourcefile.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | kabc/plugins/file/resourcefile.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kabc/plugins/file/resourcefile.cpp b/kabc/plugins/file/resourcefile.cpp index da2e4d7..fa6bc49 100644 --- a/kabc/plugins/file/resourcefile.cpp +++ b/kabc/plugins/file/resourcefile.cpp | |||
@@ -216,47 +216,48 @@ bool ResourceFile::save( Ticket *ticket ) | |||
216 | ,extension ); | 216 | ,extension ); |
217 | 217 | ||
218 | KSaveFile saveFile( mFileName ); | 218 | KSaveFile saveFile( mFileName ); |
219 | bool ok = false; | 219 | bool ok = false; |
220 | if ( saveFile.status() == 0 && saveFile.file() ) | 220 | if ( saveFile.status() == 0 && saveFile.file() ) |
221 | { | 221 | { |
222 | mFormat->saveAll( addressBook(), this, saveFile.file() ); | 222 | mFormat->saveAll( addressBook(), this, saveFile.file() ); |
223 | ok = saveFile.close(); | 223 | ok = saveFile.close(); |
224 | } | 224 | } |
225 | */ | 225 | */ |
226 | 226 | ||
227 | //US ToDo: write backupfile | 227 | //US ToDo: write backupfile |
228 | mDirWatch.stopScan(); | ||
229 | |||
228 | QFile info; | 230 | QFile info; |
229 | info.setName( mFileName ); | 231 | info.setName( mFileName ); |
230 | bool ok = info.open( IO_WriteOnly ); | 232 | bool ok = info.open( IO_WriteOnly ); |
231 | if ( ok ) { | 233 | if ( ok ) { |
232 | mFormat->saveAll( addressBook(), this, &info ); | 234 | mFormat->saveAll( addressBook(), this, &info ); |
233 | 235 | ||
234 | info.close(); | 236 | info.close(); |
235 | ok = true; | 237 | ok = true; |
236 | } | 238 | } |
237 | else { | 239 | else { |
238 | 240 | ||
239 | } | 241 | } |
240 | 242 | ||
241 | if ( !ok ) | 243 | if ( !ok ) |
242 | addressBook()->error( i18n( "Unable to save file '%1'." ).arg( mFileName ) ); | 244 | addressBook()->error( i18n( "Unable to save file '%1'." ).arg( mFileName ) ); |
243 | 245 | ||
246 | mDirWatch.startScan(); | ||
247 | |||
244 | delete ticket; | 248 | delete ticket; |
245 | unlock( mFileName ); | 249 | unlock( mFileName ); |
246 | 250 | ||
247 | return ok; | 251 | return ok; |
248 | |||
249 | qDebug("ResourceFile::save has to be changed"); | ||
250 | return true; | ||
251 | } | 252 | } |
252 | 253 | ||
253 | bool ResourceFile::lock( const QString &fileName ) | 254 | bool ResourceFile::lock( const QString &fileName ) |
254 | { | 255 | { |
255 | 256 | ||
256 | 257 | ||
257 | QString fn = fileName; | 258 | QString fn = fileName; |
258 | 259 | ||
259 | //US change the implementation how the lockfilename is getting created | 260 | //US change the implementation how the lockfilename is getting created |
260 | //US fn.replace( QRegExp("/"), "_" ); | 261 | //US fn.replace( QRegExp("/"), "_" ); |
261 | //US QString lockName = locateLocal( "data", "kabc/lock/" + fn + ".lock" ); | 262 | //US QString lockName = locateLocal( "data", "kabc/lock/" + fn + ".lock" ); |
262 | 263 | ||