Revision 9ac662e...

Go back to digest for 9th June 2013

Bug Fixes in KDE Base

David Faure committed changes in [kdelibs/KDE/4.10] /:

KConfig: fix long-standing bug where translations would not be loaded.

This happened in the following situation:
* KDEDIRS with two prefixes (let's call them global and middle)
* a kconfig file with the same name in both (e.g. a .desktop file)
* same value for Name[locale]= in both
* no override in the local directory (KDEHOME)

The Name= value in the "middle" desktop file would delete the
currently-loaded translated name, but didn't do so fully (it failed
to delete the one with bDefault==true, due to the line
"k.bDefault = false" a few lines before, which wasn't meant to
affect this). So when reading the Name[locale] in the "middle"
desktop file afterwards, it said "ok I already have it, do nothing",
and the english name prevailed.
The complexity comes from the fact that in such a setup, every key
is present twice, once with bDefault=false and once with bDefault=true.
(and then double that, for localized and non-localized).

After making bDefault=false operate on a copy of the key, a bug was
uncovered in the if (bDefault) block that was never executed before:
it should remove the key with bDefault==true, since it already did
that for bDefault==false (the 4th argument of the KEntryKey ctor).

Anyway, there's a unittest, so even if nobody ever understands my
ramblings above, at least it won't regress again.

REVIEW: 110865

File Changes

Modified 3 files
  •   kdecore/config/kconfigdata.cpp
  •   kdecore/tests/kconfigtest.cpp
  •   kdecore/tests/kconfigtest.h
3 files changed in total