<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/123542/">https://git.reviewboard.kde.org/r/123542/</a>
     </td>
    </tr>
   </table>
   <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="https://git.reviewboard.kde.org/r/123542/diff/1/?file=364188#file364188line40" style="color: black; font-weight: bold; text-decoration: underline;">src/runtime/globalshortcutsregistry.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

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



 
 

 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">35</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cp">#include "kglobalaccel_mac.h"</span></pre></td>
    <th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">40</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">foreach</span> <span class="p">(</span><span class="k">const</span> <span class="n">QString</span> <span class="o">&</span><span class="n">path</span><span class="p">,</span> <span class="n">QCoreApplication</span><span class="o">::</span><span class="n">libraryPaths</span><span class="p">())</span> <span class="p">{</span></pre></td>
  </tr>

 </tbody>

</table>

 <div style="margin-left: 2em;">

  <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;">You could use <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">KPluginLoader::forEachPlugin("org.kde.kglobalaccel5.platforms", [&](const QString& lib) { ret << lib; });</code> here.</p></pre>
 </div>
</div>
<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="https://git.reviewboard.kde.org/r/123542/diff/1/?file=364188#file364188line58" style="color: black; font-weight: bold; text-decoration: underline;">src/runtime/globalshortcutsregistry.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

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



 
 

 <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">58</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">foreach</span> <span class="p">(</span><span class="k">const</span> <span class="n">QString</span> <span class="o">&</span><span class="n">candidate</span><span class="p">,</span> <span class="n">pluginCandidates</span><span class="p">())</span> <span class="p">{</span></pre></td>
  </tr>

 </tbody>

</table>

 <div style="margin-left: 2em;">

  <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;">Actually, since all plugins have JSON metadata this can actually be further simplified by using something like this:</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #008000; font-weight: bold">auto</span> <span style="color: #008000; font-weight: bold">candidates</span> <span style="color: #666666">=</span> <span style="color: #008000; font-weight: bold">KPluginLoader</span><span style="color: #666666">:</span><span style="color: #AA22FF">:findPlugins</span><span style="color: #666666">(</span><span style="color: #BA2121">"org.kde.kglobalaccel5.platforms"</span><span style="color: #666666">);</span>
<span style="color: #008000; font-weight: bold">foreach</span> <span style="color: #666666">(</span><span style="color: #008000; font-weight: bold">const</span> <span style="color: #008000; font-weight: bold">auto</span><span style="color: #666666">&</span> <span style="color: #008000; font-weight: bold">candidate</span><span style="color: #666666">,</span> <span style="color: #008000; font-weight: bold">candidates</span><span style="color: #666666">)</span> {
   const <span style="color: #008000; font-weight: bold">auto</span> platforms <span style="color: #666666">=</span> candidate<span style="color: #666666">.</span>rawData()<span style="color: #666666">.</span>value(<span style="color: #BA2121">"platforms"</span>)<span style="color: #666666">.</span>toArray();
   foreach (const <span style="color: #008000; font-weight: bold">auto</span><span style="color: #666666">&</span> platform<span style="color: #666666">,</span> platforms) <span style="border: 1px solid #FF0000">{</span>
       if (QString<span style="color: #666666">::</span>compare(QGuiApplication<span style="color: #666666">::</span>platformName()<span style="color: #666666">,</span> platform<span style="color: #666666">.</span>toString()<span style="color: #666666">,</span> Qt<span style="color: #666666">::</span>CaseInsensitive) <span style="color: #666666">==</span> <span style="color: #666666">0</span>) <span style="border: 1px solid #FF0000">{</span>
            KGlobalAccelInterface <span style="color: #666666">*</span>interface <span style="color: #666666">=</span> qobject_cast<span style="color: #666666"><</span> KGlobalAccelInterface<span style="color: #666666">*</span> <span style="color: #666666">></span>(candidate<span style="color: #666666">.</span>instatiate());
            if (interface) <span style="border: 1px solid #FF0000">{</span>
                qCDebug(KGLOBALACCELD) <span style="color: #666666"><<</span> <span style="color: #BA2121">"Loaded plugin"</span> <span style="color: #666666"><<</span> candidate <span style="color: #666666"><<</span> <span style="color: #BA2121">"for platform"</span> <span style="color: #666666"><<</span> QGuiApplication<span style="color: #666666">::</span>platformName();
                interface<span style="color: #666666">-></span>setRegistry(parent);
                return interface;
            }
        <span style="border: 1px solid #FF0000">}</span>
    <span style="border: 1px solid #FF0000">}</span>
<span style="border: 1px solid #FF0000">}</span>
</pre></div>
</p></pre>
 </div>
</div>
<br />



<p>- Alex Richardson</p>


<br />
<p>On April 28th, 2015, 3:13 p.m. BST, Martin Gräßlin 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, kdewin and Martin Klapetek.</div>
<div>By Martin Gräßlin.</div>


<p style="color: grey;"><i>Updated April 28, 2015, 3:13 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;">The current architecture of the runtime component was to have compile
time destinctions between various platforms. This approach does not
allow to include Wayland support on Linux as both xcb and Wayland are
possible platforms which are selected at runtime and not at compile
time. Thus a change of the architecture is required.

The solution taken in this patch is to move the platform specific code
into plugins and to load the plugin specific to the currently used
platform. Therefore a new interface class is introduced which the
plugins have to implement. In addition most of the runtime is turned
into a library, so that the plugin can link it.

To properly support Wayland more changes will be required. The security
provided by the Wayland windowing system does not work well with the
architecture of kglobalacceld. Kglobalacceld is a kind of glorified
key logger. Wayland makes it impossible to be a key logger. Thus the
support for global shortcuts needs to be in the compositor. In the case
of KDE Plasma that is KWin. On that architecture we can make kglobalaccel
to still work by allowing KWin to link the new library and provide it's
own plugin. In order to support this the new private library must be
cleaned up and prepared for at least allowing a somewhat stable API/ABI.

Please note that this change also disables build for all platforms
except xcb (OSX and Windows) due to lack of a build environment.</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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">kglobalaccel5 still working on platform xcb (running here right now)</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>src/runtime/CMakeLists.txt <span style="color: grey">(8c7c7610843040fa60ab095114e7b74707f75c30)</span></li>

 <li>src/runtime/component.cpp <span style="color: grey">(663d0ade5ffe03254cc7886b76c7850d4b4317ab)</span></li>

 <li>src/runtime/globalshortcutsregistry.h <span style="color: grey">(ca12db09f4b56b0a0f0b6304da1cd1292ef65042)</span></li>

 <li>src/runtime/globalshortcutsregistry.cpp <span style="color: grey">(446e766deb96ae3a83baabaca726d5460b597b88)</span></li>

 <li>src/runtime/kglobalaccel_interface.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/runtime/kglobalaccel_interface.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/runtime/kglobalaccel_mac.h <span style="color: grey">()</span></li>

 <li>src/runtime/kglobalaccel_mac.cpp <span style="color: grey">()</span></li>

 <li>src/runtime/kglobalaccel_win.h <span style="color: grey">()</span></li>

 <li>src/runtime/kglobalaccel_win.cpp <span style="color: grey">()</span></li>

 <li>src/runtime/kglobalaccel_x11.h <span style="color: grey">(b398e1cfcf9496b58f6b05893a002c112c7cf986)</span></li>

 <li>src/runtime/kglobalaccel_x11.cpp <span style="color: grey">(2600220c255641304d4f67aad74582b01b8f799c)</span></li>

 <li>src/runtime/kglobalacceld.h <span style="color: grey">(b2fc27223ea1d11ca5a75f2ad58a8d745fb17191)</span></li>

 <li>src/runtime/plugins/CMakeLists.txt <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/runtime/plugins/xcb/CMakeLists.txt <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/runtime/plugins/xcb/xcb.json <span style="color: grey">(PRE-CREATION)</span></li>

</ul>

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






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







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