[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: Review Request 110865: KConfig: fix long-standing bug where translations would not be loaded.
From: "Oswald Buddenhagen" <ossi () kde ! org>
Date: 2013-06-18 18:33:49
Message-ID: 20130618183349.32216.53871 () vidsolbach ! de
[Download RAW message or body]
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/110865/#review34612
-----------------------------------------------------------
Ship it!
i cannot claim i would understand the relation with the higher-level cascading \
without reading all the code again, but at this low level, the change is logically \
correct afaict.
- Oswald Buddenhagen
On June 7, 2013, 1:28 p.m., David Faure wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/110865/
> -----------------------------------------------------------
>
> (Updated June 7, 2013, 1:28 p.m.)
>
>
> Review request for kdelibs and Oswald Buddenhagen.
>
>
> Description
> -------
>
> 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.
>
>
> Diffs
> -----
>
> kdecore/config/kconfigdata.cpp 8f837fb8eec896c1ceb245bc6854cdfba55cce4b
> kdecore/tests/kconfigtest.h 3b01c66fd49cda833044dfcb5f2b51c24da7f18b
> kdecore/tests/kconfigtest.cpp e5d2e80da0685615a0028ccd7254487664ffc6b0
>
> Diff: http://git.reviewboard.kde.org/r/110865/diff/
>
>
> Testing
> -------
>
> Added unittests, ensured existing ones pass.
>
> Also tested the real-world setup which triggered this bug in the first place \
> (copies of kcmodules in an overlay directory defined in /etc/kde4rc), and \
> translations not appearing in systemsettings when doing that.
>
> Thanks,
>
> David Faure
>
>
[Attachment #3 (text/html)]
<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;"> <tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://git.reviewboard.kde.org/r/110865/">http://git.reviewboard.kde.org/r/110865/</a>
</td>
</tr>
</table>
<br />
<p>Ship it!</p>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">i cannot claim i would \
understand the relation with the higher-level cascading without reading all the code \
again, but at this low level, the change is logically correct afaict.</pre> <br />
<p>- Oswald</p>
<br />
<p>On June 7th, 2013, 1:28 p.m. UTC, David Faure wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;"> <tr>
<td>
<div>Review request for kdelibs and Oswald Buddenhagen.</div>
<div>By David Faure.</div>
<p style="color: grey;"><i>Updated June 7, 2013, 1:28 p.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">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.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Added unittests, ensured existing ones pass.
Also tested the real-world setup which triggered this bug in the first place (copies \
of kcmodules in an overlay directory defined in /etc/kde4rc), and translations not \
appearing in systemsettings when doing that.</pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>kdecore/config/kconfigdata.cpp <span style="color: \
grey">(8f837fb8eec896c1ceb245bc6854cdfba55cce4b)</span></li>
<li>kdecore/tests/kconfigtest.h <span style="color: \
grey">(3b01c66fd49cda833044dfcb5f2b51c24da7f18b)</span></li>
<li>kdecore/tests/kconfigtest.cpp <span style="color: \
grey">(e5d2e80da0685615a0028ccd7254487664ffc6b0)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/110865/diff/" style="margin-left: \
3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic