[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: Review Request: Reset time format upon user request
From: "Aaron J. Seigo" <aseigo () kde ! org>
Date: 2011-12-16 19:07:02
Message-ID: 20111216190702.19210.63551 () vidsolbach ! de
[Download RAW message or body]
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/103434/#review9018
-----------------------------------------------------------
i've made it so that kcmlocale also emit the signal ... now we just need to put the \
code into the right place, wh ich i imagine is klocale_kde.cpp. it would be nice if \
KLocale also had a signal for when it changed the time format so that we could know \
for sure when it was doing with the changes instead of listening to the generic \
KGlobalSettings signal?
plasma/generic/applets/digital-clock/clock.cpp
<http://git.reviewboard.kde.org/r/103434/#comment7470>
this part belongs in klocale for sure. since this will affect all time keeping \
bits. the clock will still need to call generatePixmap() and update() though.
also, this should be checking what has been changed and only changing on \
SettingsChanged. (we don't need to do this on, for instance, icon or cursor changes \
;)
- Aaron J. Seigo
On Dec. 16, 2011, 6:35 p.m., Lamarque Vieira Souza wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/103434/
> -----------------------------------------------------------
>
> (Updated Dec. 16, 2011, 6:35 p.m.)
>
>
> Review request for kdelibs and Plasma.
>
>
> Description
> -------
>
> The patch resets time format in digital clock plasmoid when the user changes the \
> 24h configuration in active-settings.
> The reset part is from kdelibs/kdecore/localization/klocale_kde.cpp. I am wondering \
> if I should add this change to kdelibs instead of kde-workspace to avoid \
> duplicating code. Anyway, I wanted someone to review the code to see if there can \
> be any side effect.
>
> This addresses bug 289094.
> http://bugs.kde.org/show_bug.cgi?id=289094
>
>
> Diffs
> -----
>
> plasma/generic/applets/digital-clock/clock.h 4aec3fd
> plasma/generic/applets/digital-clock/clock.cpp dd03692
>
> Diff: http://git.reviewboard.kde.org/r/103434/diff/diff
>
>
> Testing
> -------
>
> Works in Plasma Active. In Plasma Desktop kcmlocale does not call \
> KGlobalSettings::self()->emitChange(KGlobalSettings::SettingsChanged) so it does \
> not take effect. Other kcm modules (e.g. keyboard), call emitChange.
>
> Thanks,
>
> Lamarque Vieira Souza
>
>
[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/103434/">http://git.reviewboard.kde.org/r/103434/</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;">i've made it so that \
kcmlocale also emit the signal ... now we just need to put the code into the right \
place, wh ich i imagine is klocale_kde.cpp. it would be nice if KLocale also had a \
signal for when it changed the time format so that we could know for sure when it was \
doing with the changes instead of listening to the generic KGlobalSettings \
signal?</pre> <br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;"> <thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;"> <a \
href="http://git.reviewboard.kde.org/r/103434/diff/1/?file=43558#file43558line105" \
style="color: black; font-weight: bold; text-decoration: \
underline;">plasma/generic/applets/digital-clock/clock.cpp</a> <span \
style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; \
"></pre></td> <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: \
0; ">void Clock::resetTimeFormat()</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">105</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="n">KConfigGroup</span> <span class="n">cg</span> <span class="o">=</span> \
<span class="n">KGlobal</span><span class="o">::</span><span \
class="n">config</span><span class="p">()</span><span class="o">-></span><span \
class="n">group</span><span class="p">(</span><span \
class="s">"Locale"</span><span class="p">);</span></pre></td> </tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">106</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> \
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">107</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="n">QString</span> <span class="n">country</span> <span class="o">=</span> \
<span class="n">KGlobal</span><span class="o">::</span><span \
class="n">locale</span><span class="p">()</span><span class="o">-></span><span \
class="n">country</span><span class="p">();</span></pre></td> </tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">108</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="n">QString</span> <span class="n">language</span> <span class="o">=</span> \
<span class="n">KGlobal</span><span class="o">::</span><span \
class="n">locale</span><span class="p">()</span><span class="o">-></span><span \
class="n">language</span><span class="p">();</span></pre></td> </tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">109</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="n">KConfig</span> <span class="n">entryFile</span><span \
class="p">(</span><span class="n">KStandardDirs</span><span class="o">::</span><span \
class="n">locate</span><span class="p">(</span><span \
class="s">"locale"</span><span class="p">,</span> <span \
class="n">QString</span><span class="o">::</span><span \
class="n">fromLatin1</span><span class="p">(</span><span \
class="s">"l10n/%1/entry.desktop"</span><span class="p">).</span><span \
class="n">arg</span><span class="p">(</span><span class="n">country</span><span \
class="p">)));</span></pre></td> </tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">110</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="n">entryFile</span><span class="p">.</span><span \
class="n">setLocale</span><span class="p">(</span><span \
class="n">language</span><span class="p">);</span></pre></td> </tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">111</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="n">KConfigGroup</span> <span class="n">entry</span><span \
class="p">(</span><span class="o">&</span><span class="n">entryFile</span><span \
class="p">,</span> <span class="s">"KCM Locale"</span><span \
class="p">);</span></pre></td> </tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">112</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> \
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">113</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="cp">#define readConfigEntry(key, default, save) \</span></pre></td> </tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">114</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="cp"> save = entry.readEntry(key, default); \</span></pre></td> </tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">115</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="cp"> save = cg.readEntry(key, save);</span></pre></td> </tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">116</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> \
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">117</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="n">QString</span> <span class="n">timeFormat</span><span \
class="p">;</span></pre></td> </tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">118</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="n">readConfigEntry</span><span class="p">(</span><span \
class="s">"TimeFormat"</span><span class="p">,</span> <span \
class="s">"%H:%M:%S"</span><span class="p">,</span> <span \
class="n">timeFormat</span><span class="p">);</span></pre></td> </tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">119</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> \
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">120</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="n">KGlobal</span><span class="o">::</span><span class="n">locale</span><span \
class="p">()</span><span class="o">-></span><span \
class="n">setTimeFormat</span><span class="p">(</span><span \
class="n">timeFormat</span><span class="p">);</span></pre></td> </tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">this part \
belongs in klocale for sure. since this will affect all time keeping bits. the clock \
will still need to call generatePixmap() and update() though.
also, this should be checking what has been changed and only changing on \
SettingsChanged. (we don't need to do this on, for instance, icon or cursor \
changes ;)</pre> </div>
<br />
<p>- Aaron J.</p>
<br />
<p>On December 16th, 2011, 6:35 p.m., Lamarque Vieira Souza wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/media/rb/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 and Plasma.</div>
<div>By Lamarque Vieira Souza.</div>
<p style="color: grey;"><i>Updated Dec. 16, 2011, 6:35 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;">The patch resets time format in digital clock plasmoid when the user \
changes the 24h configuration in active-settings.
The reset part is from kdelibs/kdecore/localization/klocale_kde.cpp. I am wondering \
if I should add this change to kdelibs instead of kde-workspace to avoid duplicating \
code. Anyway, I wanted someone to review the code to see if there can be any side \
effect.</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;">Works in Plasma Active. In Plasma Desktop kcmlocale does not call \
KGlobalSettings::self()->emitChange(KGlobalSettings::SettingsChanged) so it does \
not take effect. Other kcm modules (e.g. keyboard), call emitChange.</pre> </td>
</tr>
</table>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="http://bugs.kde.org/show_bug.cgi?id=289094">289094</a>
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>plasma/generic/applets/digital-clock/clock.h <span style="color: \
grey">(4aec3fd)</span></li>
<li>plasma/generic/applets/digital-clock/clock.cpp <span style="color: \
grey">(dd03692)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/103434/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