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

List:       kde-panel-devel
Subject:    Re: Review Request 117900: Cleanup of screenlocker
From:       "David Edmundson" <david () davidedmundson ! co ! uk>
Date:       2014-05-01 16:59:31
Message-ID: 20140501165931.20093.76261 () probe ! kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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

Ship it!



ksmserver/screenlocker/ksldapp.cpp
<https://git.reviewboard.kde.org/r/117900/#comment39770>

    I don't see why we're using lambdas here. IMHO it's makes establishGrab more \
unreadable and has no advantages.   
    Either it can be inline properly or it can be in a new function properly.


- David Edmundson


On April 30, 2014, 1:45 p.m., Martin Gräßlin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/117900/
> -----------------------------------------------------------
> 
> (Updated April 30, 2014, 1:45 p.m.)
> 
> 
> Review request for Plasma and David Edmundson.
> 
> 
> Repository: plasma-workspace
> 
> 
> Description
> -------
> 
> [screenlocker] Remove saverLockReady from org.kde.screensaver interface
> 
> Wasn't implemented.
> 
> [screenlocker] Remove setupPlasma from org.kde.screensaver interface
> 
> We don't have the plasma-overlay anymore, so let's remove it.
> 
> [screenlocker] Remove boolean trap in ::lock
> 
> Use an enum value to indicate whether there's an immediate or a delayed
> lock. At the same time lock is no longer a slot.
> 
> [screenlocker] Remove lock slot without argument
> 
> Replace by lambda slot which delegates to lock(true).
> 
> [screenlocker] Turn idleTimeout slot into lambda slot
> 
> Code is only and should only be executed after the timeoutReached signal
> from KIdleTime. Using a lambda slot enforces that as well as adding
> compile time checking for connect syntax.
> 
> [screenlocker] Turn lockProcessReady slot into a lambda slot
> 
> Code should only be executed in reply to signal
> QProcess::readyReadStandardOutput. From anywhere else it would have been
> wrong. By using a lambda slot this gets enforces and the connection gets
> compile time checked.
> 
> [screenlocker] Turn lockProcessFinished slot into a lambda slot
> 
> LockProcessFinished should only be invoked when the QProcess::finished
> signal fired. Right now it was possible to invoke that from other code
> paths. By turning it into a lambda slot this becomes more clear and we
> get compile time checking for the connection.
> 
> [screenlocker] Turn KSldApp::grabKeyboard and ::grabMouse into lambdas
> 
> It's only used by ::establishGrab and shouldn't be used from anywhere
> else. To make this more clear the code is moved into lambda functions
> in ::establishGrab.
> 
> [screenlocker] Move sanity checks for lockGrace to kcfg
> 
> Kcfg provides min/max values, so we don't need the qBound in source code
> side.
> 
> [screenlocker] Remove not needed includes
> 
> Instead of using QDesktopWidget to get the id of the X11 rootWindow we
> just ask QX11Info.
> 
> 
> Diffs
> -----
> 
> ksmserver/screenlocker/dbus/org.kde.screensaver.xml \
> e700b88215973f11b2601e5d164371874d262580  ksmserver/screenlocker/interface.h \
> 97a60737632e1cd799c0a1b09cc73ab4b580d757  ksmserver/screenlocker/interface.cpp \
> 0ce68c0d0d8aaf41588d5b5e73e66aa1b6320d15  \
> ksmserver/screenlocker/kcfg/kscreensaversettings.kcfg \
> 6a1cbb0935461c8045dd847a63e31e72fb6ca007  ksmserver/screenlocker/ksldapp.h \
> 958b55c1ff83e21d57e3c1dfb812016f325046be  ksmserver/screenlocker/ksldapp.cpp \
> c678cfc33f82509776047894e46c4fbe15563d49  
> Diff: https://git.reviewboard.kde.org/r/117900/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Martin Gräßlin
> 
> 


[Attachment #5 (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="https://git.reviewboard.kde.org/r/117900/">https://git.reviewboard.kde.org/r/117900/</a>
  </td>
    </tr>
   </table>
   <br />



 <p>Ship it!</p>









<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="https://git.reviewboard.kde.org/r/117900/diff/1/?file=269632#file269632line296" \
style="color: black; font-weight: bold; text-decoration: \
underline;">ksmserver/screenlocker/ksldapp.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="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; \
">KActionCollection *KSldApp::actionCollection()</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">287</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span \
class="k">auto</span> <span class="n">grabMouse</span> <span class="o">=</span> <span \
class="p">[]()</span> <span class="o">-&gt;</span> <span class="kt">bool</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;">I don&#39;t \
see why we&#39;re using lambdas here. IMHO it&#39;s makes establishGrab more \
unreadable and has no advantages. 

Either it can be inline properly or it can be in a new function properly.</pre>
</div>
<br />



<p>- David Edmundson</p>


<br />
<p>On April 30th, 2014, 1:45 p.m. UTC, Martin Gräßlin wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('https://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 Plasma and David Edmundson.</div>
<div>By Martin Gräßlin.</div>


<p style="color: grey;"><i>Updated April 30, 2014, 1:45 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
plasma-workspace
</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;">[screenlocker] Remove saverLockReady from org.kde.screensaver interface

Wasn&#39;t implemented.

[screenlocker] Remove setupPlasma from org.kde.screensaver interface

We don&#39;t have the plasma-overlay anymore, so let&#39;s remove it.

[screenlocker] Remove boolean trap in ::lock

Use an enum value to indicate whether there&#39;s an immediate or a delayed
lock. At the same time lock is no longer a slot.

[screenlocker] Remove lock slot without argument

Replace by lambda slot which delegates to lock(true).

[screenlocker] Turn idleTimeout slot into lambda slot

Code is only and should only be executed after the timeoutReached signal
from KIdleTime. Using a lambda slot enforces that as well as adding
compile time checking for connect syntax.

[screenlocker] Turn lockProcessReady slot into a lambda slot

Code should only be executed in reply to signal
QProcess::readyReadStandardOutput. From anywhere else it would have been
wrong. By using a lambda slot this gets enforces and the connection gets
compile time checked.

[screenlocker] Turn lockProcessFinished slot into a lambda slot

LockProcessFinished should only be invoked when the QProcess::finished
signal fired. Right now it was possible to invoke that from other code
paths. By turning it into a lambda slot this becomes more clear and we
get compile time checking for the connection.

[screenlocker] Turn KSldApp::grabKeyboard and ::grabMouse into lambdas

It&#39;s only used by ::establishGrab and shouldn&#39;t be used from anywhere
else. To make this more clear the code is moved into lambda functions
in ::establishGrab.

[screenlocker] Move sanity checks for lockGrace to kcfg

Kcfg provides min/max values, so we don&#39;t need the qBound in source code
side.

[screenlocker] Remove not needed includes

Instead of using QDesktopWidget to get the id of the X11 rootWindow we
just ask QX11Info.</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>ksmserver/screenlocker/dbus/org.kde.screensaver.xml <span style="color: \
grey">(e700b88215973f11b2601e5d164371874d262580)</span></li>

 <li>ksmserver/screenlocker/interface.h <span style="color: \
grey">(97a60737632e1cd799c0a1b09cc73ab4b580d757)</span></li>

 <li>ksmserver/screenlocker/interface.cpp <span style="color: \
grey">(0ce68c0d0d8aaf41588d5b5e73e66aa1b6320d15)</span></li>

 <li>ksmserver/screenlocker/kcfg/kscreensaversettings.kcfg <span style="color: \
grey">(6a1cbb0935461c8045dd847a63e31e72fb6ca007)</span></li>

 <li>ksmserver/screenlocker/ksldapp.h <span style="color: \
grey">(958b55c1ff83e21d57e3c1dfb812016f325046be)</span></li>

 <li>ksmserver/screenlocker/ksldapp.cpp <span style="color: \
grey">(c678cfc33f82509776047894e46c4fbe15563d49)</span></li>

</ul>

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







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








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



_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


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

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