Changeset View
Changeset View
Standalone View
Standalone View
src/core/kconfigini.cpp
Show First 20 Lines • Show All 423 Lines • ▼ Show 20 Line(s) | 423 | for (KEntryMapIterator it = entryMap.begin(); it != end; ++it) { | |||
---|---|---|---|---|---|
424 | if (!it.key().mKey.isEmpty() && !it->bDirty) { // not dirty, doesn't overwrite entry in writeMap. skips default entries, too. | 424 | if (!it.key().mKey.isEmpty() && !it->bDirty) { // not dirty, doesn't overwrite entry in writeMap. skips default entries, too. | ||
425 | continue; | 425 | continue; | ||
426 | } | 426 | } | ||
427 | 427 | | |||
428 | const KEntryKey &key = it.key(); | 428 | const KEntryKey &key = it.key(); | ||
429 | 429 | | |||
430 | // only write entries that have the same "globality" as the file | 430 | // only write entries that have the same "globality" as the file | ||
431 | if (it->bGlobal == bGlobal) { | 431 | if (it->bGlobal == bGlobal) { | ||
432 | if (it->bReverted) { | 432 | if (it->bReverted && it->bForceSave) { | ||
433 | it->bDeleted = true; | ||||
434 | writeMap[key] = *it; | ||||
435 | } else if (it->bReverted) { | ||||
dfaure: Wouldn't it be enough to ensure that bReverted is false?
This would make for a much more… | |||||
433 | writeMap.remove(key); | 436 | writeMap.remove(key); | ||
434 | } else if (!it->bDeleted) { | 437 | } else if (!it->bDeleted) { | ||
435 | writeMap[key] = *it; | 438 | writeMap[key] = *it; | ||
436 | } else { | 439 | } else { | ||
437 | KEntryKey defaultKey = key; | 440 | KEntryKey defaultKey = key; | ||
438 | defaultKey.bDefault = true; | 441 | defaultKey.bDefault = true; | ||
439 | if (!entryMap.contains(defaultKey)) { | 442 | if (!entryMap.contains(defaultKey)) { | ||
440 | writeMap.remove(key); // remove the deleted entry if there is no default | 443 | writeMap.remove(key); // remove the deleted entry if there is no default | ||
▲ Show 20 Lines • Show All 480 Lines • Show Last 20 Lines |
Wouldn't it be enough to ensure that bReverted is false?
This would make for a much more minimal patch....