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

List:       kde-frameworks-devel
Subject:    Re: Review Request 122981: add KGlobalAccel::loadShortcutFromGlobalSettings
From:       Martin_Gräßlin <mgraesslin () kde ! org>
Date:       2015-03-23 7:56:24
Message-ID: 20150323075624.18119.14874 () mimi ! kde ! org
[Download RAW message or body]

--===============6946722294729805680==
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit



> On March 22, 2015, 4:56 p.m., Albert Astals Cid wrote:
> > src/kglobalaccel.h, line 260
> > <https://git.reviewboard.kde.org/r/122981/diff/2/?file=356138#file356138line260>
> > 
> > typo in following
> 
> Gregor Mi wrote:
> About why it is needed: see \
> KGlobalShortcutTest::testLoadShortcutFromGlobalSettings: shortcut() does not behave \
> as expected when the new method loadShortcutFromGlobalSettings() is not called 
> I don't know if always calling loadShortcutFromGlobalSettings() before shortcut() \
> would break existing code. E.g. in kwin/effects/desktopgrid/desktopgrid_config.cpp \
> shortcut() is used without prior call of loadShortcutFromGlobalSettings(). 
> On the other hand, a call to loadShortcutFromGlobalSettings() might be harmless but \
> I don't have a good overview of the KGlobalAccel usage patterns. 
> Albert Astals Cid wrote:
> Honestly i have no idea on how this kglobalaccel thing works, but it seems to me \
> you're just adding a way to workaround a bug instead of fixing it. 
> Gregor Mi wrote:
> Me neither :-)
> 
> I was hoping that someone with more experience with kglobalaccel can say more about \
> the proposed solution. 
> Like you Thomas suggested to put the loading method into shortcut() (which is \
> essentially a one-liner: d->updateGlobalShortcut(action, \
> KGlobalAccelPrivate::ActiveShortcut, KGlobalAccel::Autoloading);).

well we could try it: add the one-line change and try whether the unit tests pass and \
then try whether the case in DesktopGridConfig works.

Unfortunately I'm also not that into KGloalAccel code yet to be 100 % whether it's a \
valid change :-(


- Martin


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/122981/#review77912
-----------------------------------------------------------


On March 22, 2015, 5:05 p.m., Gregor Mi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/122981/
> -----------------------------------------------------------
> 
> (Updated March 22, 2015, 5:05 p.m.)
> 
> 
> Review request for KDE Frameworks, Martin Gräßlin and Thomas Lübking.
> 
> 
> Repository: kglobalaccel
> 
> 
> Description
> -------
> 
> In some cases you need to call loadShortcutFromGlobalSettings() in order not to get \
> a an empty list when calling shortcut(). See discussion in \
> https://git.reviewboard.kde.org/r/122249/. 
> 
> Diffs
> -----
> 
> autotests/kglobalshortcuttest.h 2a7b40d34875e16345a659fb9764e4f536ad79c6 
> autotests/kglobalshortcuttest.cpp 169bf92ffbff985cd4381e771c2fcecaff77156b 
> src/kglobalaccel.h 3fe20ca8e4ec6ceb0bb9e54235aef7f1aeeb8c16 
> src/kglobalaccel.cpp 1b6b3f5cb6d42401d684e6a491d12a6e57248fd1 
> 
> Diff: https://git.reviewboard.kde.org/r/122981/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Gregor Mi
> 
> 


--===============6946722294729805680==
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 8bit




<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 \
solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">  \
<tr>  <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/122981/">https://git.reviewboard.kde.org/r/122981/</a>
  </td>
    </tr>
   </table>
   <br />










<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On March 22nd, 2015, 4:56 p.m. CET, <b>Albert \
Astals Cid</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px \
solid #d0d0d0; padding-left: 10px;">  


<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="https://git.reviewboard.kde.org/r/122981/diff/2/?file=356138#file356138line260" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/kglobalaccel.h</a>  <span style="font-weight: normal;">

     (Diff revision 2)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; \
">public:</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">260</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="cm">     * follwing internal settings will be used (see also implementation \
of</span></pre></td>  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">typo \
in following</p></pre>  </blockquote>



 <p>On March 22nd, 2015, 5:12 p.m. CET, <b>Gregor Mi</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">About \
why it is needed: see KGlobalShortcutTest::testLoadShortcutFromGlobalSettings: \
shortcut() does not behave as expected when the new method \
loadShortcutFromGlobalSettings() is not called</p> <p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I \
don't know if always calling loadShortcutFromGlobalSettings() before shortcut() would \
break existing code. E.g. in kwin/effects/desktopgrid/desktopgrid_config.cpp \
shortcut() is used without prior call of loadShortcutFromGlobalSettings().</p> <p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">On the other hand, a call to loadShortcutFromGlobalSettings() might be \
harmless but I don't have a good overview of the KGlobalAccel usage \
patterns.</p></pre>  </blockquote>





 <p>On March 22nd, 2015, 5:24 p.m. CET, <b>Albert Astals Cid</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">Honestly i have no idea on how this kglobalaccel thing works, but it seems \
to me you're just adding a way to workaround a bug instead of fixing it.</p></pre>  \
</blockquote>





 <p>On March 22nd, 2015, 5:39 p.m. CET, <b>Gregor Mi</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Me \
neither :-)</p> <p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">I was hoping that someone with more experience with \
kglobalaccel can say more about the proposed solution.</p> <p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Like \
you Thomas suggested to put the loading method into shortcut() (which is essentially \
a one-liner: d-&gt;updateGlobalShortcut(action, KGlobalAccelPrivate::ActiveShortcut, \
KGlobalAccel::Autoloading);).</p></pre>  </blockquote>







</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">well we could try it: add the one-line change and try whether the unit \
tests pass and then try whether the case in DesktopGridConfig works.</p> <p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">Unfortunately I'm also not that into KGloalAccel code yet to be 100 % \
whether it's a valid change :-(</p></pre> <br />




<p>- Martin</p>


<br />
<p>On March 22nd, 2015, 5:05 p.m. CET, Gregor Mi wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: \
1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; \
-webkit-border-radius: 6px;">  <tr>
  <td>

<div>Review request for KDE Frameworks, Martin Gräßlin and Thomas Lübking.</div>
<div>By Gregor Mi.</div>


<p style="color: grey;"><i>Updated March 22, 2015, 5:05 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kglobalaccel
</div>


<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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">In some cases you need to call \
loadShortcutFromGlobalSettings() in order not to get a an empty list when calling \
shortcut(). See discussion in https://git.reviewboard.kde.org/r/122249/.</p></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>autotests/kglobalshortcuttest.h <span style="color: \
grey">(2a7b40d34875e16345a659fb9764e4f536ad79c6)</span></li>

 <li>autotests/kglobalshortcuttest.cpp <span style="color: \
grey">(169bf92ffbff985cd4381e771c2fcecaff77156b)</span></li>

 <li>src/kglobalaccel.h <span style="color: \
grey">(3fe20ca8e4ec6ceb0bb9e54235aef7f1aeeb8c16)</span></li>

 <li>src/kglobalaccel.cpp <span style="color: \
grey">(1b6b3f5cb6d42401d684e6a491d12a6e57248fd1)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/122981/diff/" style="margin-left: \
3em;">View Diff</a></p>






  </td>
 </tr>
</table>







  </div>
 </body>
</html>


--===============6946722294729805680==--


[Attachment #3 (text/plain)]

_______________________________________________
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


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

Configure | About | News | Add a list | Sponsored by KoreLogic