[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Review Request: KLocale: Keep track of original
From:       "Oswald Buddenhagen" <ossi () kde ! org>
Date:       2010-12-05 9:13:54
Message-ID: 20101205091354.23593.73652 () vidsolbach ! de
[Download RAW message or body]

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/6047/#review9131
-----------------------------------------------------------


the kconfig magic is a monstrosity, but it seems reasonably safe.
though i wonder whether it wouldn't be better to get everything you may lat=
er need from the config and then just throw it away ...


- Oswald


On 2010-12-05 02:08:07, John Layt wrote:
> =

> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/6047/
> -----------------------------------------------------------
> =

> (Updated 2010-12-05 02:08:07)
> =

> =

> Review request for kdelibs.
> =

> =

> Summary
> -------
> =

> KLocale can be constructed with reference to a config file, variously pas=
sed in as either a KSharedConfig::Ptr or KConfig*, or just defaulting to th=
e global, however KLocale doesn't keep track of the original config used as=
 it hasn't needed to.  Now however KCalendarSystem also reads some user set=
tings from the config file, but the delayed creation of the calendar object=
 by KLocale means the config file is not available when needed and so those=
 settings are effectively ignored.  Changing the calendar system also requi=
res the config for the new calendar system to be read.
> =

> This fix keeps a KSharedConfig pointer to the config file in KLocale (nul=
l if using the global) and cleans up some use of the config itself.  Howeve=
r I'm a little uncertain I've done the right thing when a KConfig* is passe=
d in rather than a KSharedConfig::Ptr, taking a copy of the KConfig in a ne=
w KSharedConfig seemed the only way, unless someone knows a better option. =
 I'm also not sure when doing the copy if the new KSharedConfig should use =
the same file name as the original KConfig, a null QString(), or something =
else?
> =

> Note: the apidox already warns that when passing the KSharedConfig::Ptr i=
n that it must exist for the life of the KLocale object, but there's no suc=
h warning on the KConfig* constructor or setCountry/setLanguage methods.
> =

> =

> Diffs
> -----
> =

>   /trunk/KDE/kdelibs/kdecore/localization/klocale.cpp 1203620 =

>   /trunk/KDE/kdelibs/kdecore/localization/klocale_kde.cpp 1203620 =

>   /trunk/KDE/kdelibs/kdecore/localization/klocale_mac.cpp 1203620 =

>   /trunk/KDE/kdelibs/kdecore/localization/klocale_mac_p.h 1203620 =

>   /trunk/KDE/kdelibs/kdecore/localization/klocale_p.h 1203620 =

>   /trunk/KDE/kdelibs/kdecore/localization/klocale_unix.cpp 1203620 =

>   /trunk/KDE/kdelibs/kdecore/localization/klocale_unix_p.h 1203620 =

>   /trunk/KDE/kdelibs/kdecore/localization/klocale_win.cpp 1203620 =

>   /trunk/KDE/kdelibs/kdecore/localization/klocale_win_p.h 1203620 =

> =

> Diff: http://svn.reviewboard.kde.org/r/6047/diff
> =

> =

> Testing
> -------
> =

> All unit tests pass, my problem with KCalendarSystem not loading user set=
tings when created by a KLocale is fixed.
> =

> =

> Thanks,
> =

> John
> =

>


[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://svn.reviewboard.kde.org/r/6047/">http://svn.reviewboard.kde.org/r/6047/</a>
  </td>
    </tr>
   </table>
   <br />





 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">the kconfig magic is a \
monstrosity, but it seems reasonably safe. though i wonder whether it wouldn&#39;t be \
better to get everything you may later need from the config and then just throw it \
away ... </pre>
 <br />







<p>- Oswald</p>


<br />
<p>On December 5th, 2010, 2:08 a.m., John Layt wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://svn.reviewboard.kde.orgrb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for kdelibs.</div>
<div>By John Layt.</div>


<p style="color: grey;"><i>Updated 2010-12-05 02:08:07</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;">KLocale can be constructed with reference to a config file, variously \
passed in as either a KSharedConfig::Ptr or KConfig*, or just defaulting to the \
global, however KLocale doesn&#39;t keep track of the original config used as it \
hasn&#39;t needed to.  Now however KCalendarSystem also reads some user settings from \
the config file, but the delayed creation of the calendar object by KLocale means the \
config file is not available when needed and so those settings are effectively \
ignored.  Changing the calendar system also requires the config for the new calendar \
system to be read.

This fix keeps a KSharedConfig pointer to the config file in KLocale (null if using \
the global) and cleans up some use of the config itself.  However I&#39;m a little \
uncertain I&#39;ve done the right thing when a KConfig* is passed in rather than a \
KSharedConfig::Ptr, taking a copy of the KConfig in a new KSharedConfig seemed the \
only way, unless someone knows a better option.  I&#39;m also not sure when doing the \
copy if the new KSharedConfig should use the same file name as the original KConfig, \
a null QString(), or something else?

Note: the apidox already warns that when passing the KSharedConfig::Ptr in that it \
must exist for the life of the KLocale object, but there&#39;s no such warning on the \
KConfig* constructor or setCountry/setLanguage methods.</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;">All unit tests pass, my problem with KCalendarSystem not loading user \
settings when created by a KLocale is fixed.</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>/trunk/KDE/kdelibs/kdecore/localization/klocale.cpp <span style="color: \
grey">(1203620)</span></li>

 <li>/trunk/KDE/kdelibs/kdecore/localization/klocale_kde.cpp <span style="color: \
grey">(1203620)</span></li>

 <li>/trunk/KDE/kdelibs/kdecore/localization/klocale_mac.cpp <span style="color: \
grey">(1203620)</span></li>

 <li>/trunk/KDE/kdelibs/kdecore/localization/klocale_mac_p.h <span style="color: \
grey">(1203620)</span></li>

 <li>/trunk/KDE/kdelibs/kdecore/localization/klocale_p.h <span style="color: \
grey">(1203620)</span></li>

 <li>/trunk/KDE/kdelibs/kdecore/localization/klocale_unix.cpp <span style="color: \
grey">(1203620)</span></li>

 <li>/trunk/KDE/kdelibs/kdecore/localization/klocale_unix_p.h <span style="color: \
grey">(1203620)</span></li>

 <li>/trunk/KDE/kdelibs/kdecore/localization/klocale_win.cpp <span style="color: \
grey">(1203620)</span></li>

 <li>/trunk/KDE/kdelibs/kdecore/localization/klocale_win_p.h <span style="color: \
grey">(1203620)</span></li>

</ul>

<p><a href="http://svn.reviewboard.kde.org/r/6047/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