-rw-r--r-- | microkde/kconfig.cpp | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/microkde/kconfig.cpp b/microkde/kconfig.cpp index 3f23ed2..b882adb 100644 --- a/microkde/kconfig.cpp +++ b/microkde/kconfig.cpp | |||
@@ -338,6 +338,18 @@ bool KConfig::deleteGroup( const QString& group) | |||
338 | int pos; | 338 | int pos; |
339 | 339 | ||
340 | QMap<QString,bool>::Iterator itBool; | 340 | QMap<QString,bool>::Iterator itBool; |
341 | QMap<QString,bool>::Iterator delBool; | ||
342 | while ( itBool != mBoolMap.end() ) { | ||
343 | pos = itBool.key().find( group ); | ||
344 | if (pos == 0) { | ||
345 | delBool = itBool; | ||
346 | ++itBool; | ||
347 | mBoolMap.remove(delBool); | ||
348 | dirty = true; | ||
349 | } | ||
350 | |||
351 | } | ||
352 | /* | ||
341 | for( itBool = mBoolMap.begin(); itBool != mBoolMap.end(); ++itBool ) | 353 | for( itBool = mBoolMap.begin(); itBool != mBoolMap.end(); ++itBool ) |
342 | { | 354 | { |
343 | pos = itBool.key().find( group ); | 355 | pos = itBool.key().find( group ); |
@@ -346,8 +358,21 @@ bool KConfig::deleteGroup( const QString& group) | |||
346 | dirty = true; | 358 | dirty = true; |
347 | } | 359 | } |
348 | } | 360 | } |
361 | */ | ||
362 | QMap<QString,QString>::Iterator itString = mStringMap.begin(); | ||
363 | QMap<QString,QString>::Iterator delString ; | ||
364 | while( itString != mStringMap.end() ) { | ||
365 | pos = itString.key().find( group ); | ||
366 | if (pos == 0) { | ||
367 | delString = itString; | ||
368 | ++itString; | ||
369 | mStringMap.remove(delString); | ||
370 | //qDebug("delte++++++++++++++++++ "); | ||
371 | dirty = true; | ||
372 | } | ||
349 | 373 | ||
350 | QMap<QString,QString>::Iterator itString; | 374 | } |
375 | /* this leads to a memory access violation | ||
351 | for( itString = mStringMap.begin(); itString != mStringMap.end(); ++itString ) | 376 | for( itString = mStringMap.begin(); itString != mStringMap.end(); ++itString ) |
352 | { | 377 | { |
353 | pos = itString.key().find( group ); | 378 | pos = itString.key().find( group ); |
@@ -356,8 +381,20 @@ bool KConfig::deleteGroup( const QString& group) | |||
356 | dirty = true; | 381 | dirty = true; |
357 | } | 382 | } |
358 | } | 383 | } |
359 | 384 | */ | |
360 | QMap<QString,QDateTime>::Iterator itDateTime; | 385 | QMap<QString,QDateTime>::Iterator itDateTime= mDateTimeMap.begin(); |
386 | QMap<QString,QDateTime>::Iterator delDateTime; | ||
387 | while ( itDateTime != mDateTimeMap.end() ) { | ||
388 | pos = itDateTime.key().find( group ); | ||
389 | if (pos == 0) { | ||
390 | delDateTime = itDateTime; | ||
391 | ++itDateTime; | ||
392 | mDateTimeMap.remove(delDateTime); | ||
393 | dirty = true; | ||
394 | } | ||
395 | |||
396 | } | ||
397 | /* | ||
361 | for( itDateTime = mDateTimeMap.begin(); itDateTime != mDateTimeMap.end(); ++itDateTime ) | 398 | for( itDateTime = mDateTimeMap.begin(); itDateTime != mDateTimeMap.end(); ++itDateTime ) |
362 | { | 399 | { |
363 | pos = itDateTime.key().find( group ); | 400 | pos = itDateTime.key().find( group ); |
@@ -366,6 +403,7 @@ bool KConfig::deleteGroup( const QString& group) | |||
366 | dirty = true; | 403 | dirty = true; |
367 | } | 404 | } |
368 | } | 405 | } |
406 | */ | ||
369 | 407 | ||
370 | if (dirty) | 408 | if (dirty) |
371 | mDirty = true; | 409 | mDirty = true; |