<table><tr><td style="">broulik added inline comments.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D21725">View Revision</a></tr></table><br /><div><strong>INLINE COMMENTS</strong><div><div style="margin: 6px 0 12px 0;"><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D21725#inline-122196">View Inline</a><span style="color: #4b4d51; font-weight: bold;">fvogt</span> wrote in <span style="color: #4b4d51; font-weight: bold;">startplasma-wayland.cpp:41</span></div>
<div style="margin: 8px 0; padding: 0 12px; color: #74777D;"><p style="padding: 0; margin: 8px;">AFAICT this won't work as expected: localed is only launched on demand, which <tt style="background: #ebebeb; font-size: 13px;">isServiceRegistered</tt> does not care about.</p></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Indeed. When it's not registered, query</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">"org.freedesktop.DBus",
"/org/freedesktop/DBus",
"org.freedesktop.DBus",
"ListActivatableNames"</pre></div>

<p style="padding: 0; margin: 8px;">(unfortunately no Qt API for that) and then call <tt style="background: #ebebeb; font-size: 13px;">startService()</tt></p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D21725#inline-122287">View Inline</a><span style="color: #4b4d51; font-weight: bold;">startplasma-wayland.cpp:43</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span style="color: #aa4000">auto</span> <span class="n">queryAndSet</span> <span style="color: #aa2211">=</span> <span class="p">[](</span><span style="color: #aa4000">const</span> <span class="n">QByteArray</span> <span style="color: #aa2211">&</span><span class="n">var</span><span class="p">,</span> <span style="color: #aa4000">const</span> <span class="n">QByteArray</span> <span style="color: #aa2211">&</span> <span class="n">value</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">            <span class="n">QDBusInterface</span> <span class="n">iface</span><span class="p">(</span><span class="n">QStringLiteral</span><span class="p">(</span><span style="color: #766510">"org.freedesktop.locale1"</span><span class="p">),</span> <span class="n">QStringLiteral</span><span class="p">(</span><span style="color: #766510">"/org/freedesktop/locale1"</span><span class="p">),</span> <span class="n">QStringLiteral</span><span class="p">(</span><span style="color: #766510">"org.freedesktop.locale1"</span><span class="p">),</span> <span class="n">QDBusConnection</span><span style="color: #aa2211">::</span><span class="n">systemBus</span><span class="p">());</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Please use a DBus-interface generated from XML instead of <tt style="background: #ebebeb; font-size: 13px;">QDBusInterface</tt> to avoid doing a blocking introspection call.<br />
You also might want to move the object outside the lamda so it's not recreated for every call you do below.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D21725#inline-122289">View Inline</a><span style="color: #4b4d51; font-weight: bold;">startplasma-x11.cpp:78</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">                <span class="n">qputenv</span><span class="p">(</span><span style="color: #766510">"GDK_SCALE"</span><span class="p">,</span> <span class="n">screenScaleFactors</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">                <span class="n">qputenv</span><span class="p">(</span><span style="color: #766510">"GDK_DPI_SCALE"</span><span class="p">,</span> <span class="n">QByteArray</span><span style="color: #aa2211">::</span><span class="n">number</span><span class="p">(</span><span style="color: #601200">1</span><span style="color: #aa2211">/</span><span class="n">screenScaleFactors</span><span class="p">.</span><span class="n">toInt</span><span class="p">(),</span> <span style="color: #766510">'g'</span><span class="p">,</span> <span style="color: #601200">3</span><span class="p">));</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">            <span class="p">}</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Won't that do an integer division?</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D21725#inline-122291">View Inline</a><span style="color: #4b4d51; font-weight: bold;">startplasma.cpp:82</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="n">QStringList</span> <span class="n">filteredFiles</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="n">std</span><span style="color: #aa2211">::</span><span class="n">copy_if</span><span class="p">(</span><span class="n">files</span><span class="p">.</span><span class="n">begin</span><span class="p">(),</span> <span class="n">files</span><span class="p">.</span><span class="n">end</span><span class="p">(),</span> <span class="n">std</span><span style="color: #aa2211">::</span><span class="n">back_inserter</span><span class="p">(</span><span class="n">filteredFiles</span><span class="p">),</span> <span class="p">[](</span><span style="color: #aa4000">const</span> <span class="n">QString</span><span style="color: #aa2211">&</span> <span class="n">i</span><span class="p">){</span> <span style="color: #aa4000">return</span> <span class="n">QFileInfo</span><span class="p">(</span><span class="n">i</span><span class="p">).</span><span class="n">isReadable</span><span class="p">();</span> <span class="p">}</span> <span class="p">);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Should we also check for executable permission?</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D21725#inline-122292">View Inline</a><span style="color: #4b4d51; font-weight: bold;">startplasma.cpp:241</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="n">runSync</span><span class="p">(</span><span class="n">QStringLiteral</span><span class="p">(</span><span style="color: #766510">"xsetroot"</span><span class="p">),</span> <span class="p">{</span><span class="n">QStringLiteral</span><span class="p">(</span><span style="color: #766510">"-cursor_name"</span><span class="p">),</span> <span class="n">QStringLiteral</span><span class="p">(</span><span style="color: #766510">"left_ptr"</span><span class="p">)});</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="n">runSync</span><span class="p">(</span><span class="n">QStringLiteral</span><span class="p">(</span><span style="color: #766510">"xprop"</span><span class="p">),</span> <span class="p">{</span><span class="n">QStringLiteral</span><span class="p">(</span><span style="color: #766510">"-root"</span><span class="p">),</span> <span class="n">QStringLiteral</span><span class="p">(</span><span style="color: #766510">"-f"</span><span class="p">),</span> <span class="n">QStringLiteral</span><span class="p">(</span><span style="color: #766510">"KDE_FULL_SESSION"</span><span class="p">),</span> <span class="n">QStringLiteral</span><span class="p">(</span><span style="color: #766510">"8t"</span><span class="p">),</span> <span class="n">QStringLiteral</span><span class="p">(</span><span style="color: #766510">"-set"</span><span class="p">),</span> <span class="n">QStringLiteral</span><span class="p">(</span><span style="color: #766510">"KDE_FULL_SESSION"</span><span class="p">),</span> <span class="n">QStringLiteral</span><span class="p">(</span><span style="color: #766510">"true"</span><span class="p">)});</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Would it make a difference using libxcb for this instead of spawning an external process synchronously here?</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D21725#inline-122293">View Inline</a><span style="color: #4b4d51; font-weight: bold;">startplasma.cpp:293</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #aa4000">static</span> <span style="color: #aa4000">bool</span> <span class="n">dl</span> <span style="color: #aa2211">=</span> <span style="color: #304a96">false</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">descriptive variable name, please.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D21725#inline-122294">View Inline</a><span style="color: #4b4d51; font-weight: bold;">startplasma.cpp:308</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">            <span class="n">p</span> <span style="color: #aa2211">=</span> <span style="color: #aa4000">new</span> <span class="n">QProcess</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">            <span class="n">p</span><span style="color: #aa2211">-></span><span class="n">start</span><span class="p">(</span><span class="n">QStringLiteral</span><span class="p">(</span><span style="color: #766510">"ksplashqml"</span><span class="p">),</span> <span class="p">{</span> <span class="n">ksplashCfg</span><span class="p">.</span><span class="n">readEntry</span><span class="p">(</span><span style="color: #766510">"Theme"</span><span class="p">,</span> <span class="n">QStringLiteral</span><span class="p">(</span><span style="color: #766510">"Breeze"</span><span class="p">))</span> <span class="p">});</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span class="p">}</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">KSplash internally forks and prints the PID on stdout which doesn't seem neccessary anymore with this new code. (Optimization for the future maybe)</p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R120 Plasma Workspace</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D21725">https://phabricator.kde.org/D21725</a></div></div><br /><div><strong>To: </strong>apol, Plasma, fvogt<br /><strong>Cc: </strong>broulik, fvogt, davidedmundson, plasma-devel, LeGast00n, ericadams, jraleigh, GB_2, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart<br /></div>