<table><tr><td style="">graesslin 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/D3617" rel="noreferrer">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/D3617#inline-14398" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">kwinwaylandbackend.cpp:59-63</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: #d0ffd0;"> <span class="n">foreach</span> <span class="p">(</span><span class="n">QObject</span> <span style="color: #aa2211">*</span><span class="n">d</span><span class="p">,</span> <span class="n">m_devices</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">if</span> <span class="p">(</span><span class="n">d</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">delete</span> <span class="n">d</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="p">}</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="p">}</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">check qDeleteAll</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/D3617#inline-14399" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">kwinwaylandbackend.cpp:60-61</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: #d0ffd0;"> <span class="n">foreach</span> <span class="p">(</span><span class="n">QObject</span> <span style="color: #aa2211">*</span><span class="n">d</span><span class="p">,</span> <span class="n">m_devices</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">if</span> <span class="p">(</span><span class="n">d</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">delete</span> <span class="n">d</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="p">}</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">in general you can delete a nullptr, so the ifcheck is not needed</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/D3617#inline-14402" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">kwinwaylandbackend.cpp:72</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: #d0ffd0;"> <span class="n">QStringList</span> <span class="n">devicesSysNames</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">QVariant</span> <span class="n">reply</span> <span style="color: #aa2211">=</span> <span class="n">m_deviceManager</span><span style="color: #aa2211">-></span><span class="n">property</span><span class="p">(</span><span style="color: #766510">"devicesSysNames"</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">if</span> <span class="p">(</span><span class="n">reply</span><span class="p">.</span><span class="n">isValid</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;">const</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/D3617#inline-14400" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">kwinwaylandbackend.cpp:79</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: #d0ffd0;"> <span class="n">qCCritical</span><span class="p">(</span><span class="n">KCM_TOUCHPAD</span><span class="p">)</span> <span style="color: #aa2211"><<</span> <span style="color: #766510">"Error on receiving device list from KWin."</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">m_errorString</span> <span style="color: #aa2211">=</span> <span class="n">i18n</span><span class="p">(</span><span style="color: #766510">"Error on receiving device list from KWin. Please restart Touchpad KCM."</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">return</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">We normally don't use the name "KWin" in user facing messages. Also I don't expect users to know what a "KCM" is ;-)</p>
<p style="padding: 0; margin: 8px;">Suggestion: "Querying input devices failed. Please reopen this settings module".</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/D3617#inline-14401" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">kwinwaylandbackend.cpp:84</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: #d0ffd0;"> <span style="color: #aa4000">bool</span> <span class="n">touchpadFound</span> <span style="color: #aa2211">=</span> <span style="color: #304a96">false</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">foreach</span> <span class="p">(</span><span class="n">QString</span> <span class="n">sn</span><span class="p">,</span> <span class="n">devicesSysNames</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">QDBusInterface</span> <span class="n">deviceIface</span><span class="p">(</span><span class="n">QStringLiteral</span><span class="p">(</span><span style="color: #766510">"org.kde.KWin"</span><span class="p">),</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">please don't use the Q_FOREACH in new code as Qt might deprecate it.</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/D3617#inline-14403" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">kwinwaylandbackend.cpp:90</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: #d0ffd0;"> <span style="color: #aa4000">this</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">QVariant</span> <span class="n">reply</span> <span style="color: #aa2211">=</span> <span class="n">deviceIface</span><span class="p">.</span><span class="n">property</span><span class="p">(</span><span style="color: #766510">"touchpad"</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">if</span> <span class="p">(</span><span class="n">reply</span><span class="p">.</span><span class="n">isValid</span><span class="p">()</span> <span style="color: #aa2211">&&</span> <span class="n">reply</span><span class="p">.</span><span class="n">toBool</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;">const</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/D3617#inline-14404" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">kwinwaylandbackend.cpp:95</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: #d0ffd0;"> <span class="n">qCCritical</span><span class="p">(</span><span class="n">KCM_TOUCHPAD</span><span class="p">)</span> <span style="color: #aa2211"><<</span> <span style="color: #766510">"Error on creating touchpad object"</span> <span style="color: #aa2211"><<</span> <span class="n">sn</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">m_errorString</span> <span style="color: #aa2211">=</span> <span class="n">i18n</span><span class="p">(</span><span style="color: #766510">"Error on creating touchpad object. Please restart KCM."</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">return</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">I doubt a restart would help here. That should run in an error again.</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/D3617#inline-14405" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">kwinwaylandbackend.cpp:107-113</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: #d0ffd0;"> <span style="color: #aa4000">bool</span> <span class="n">success</span> <span style="color: #aa2211">=</span> <span style="color: #304a96">true</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">foreach</span><span class="p">(</span><span class="n">QObject</span> <span style="color: #aa2211">*</span><span class="n">t</span><span class="p">,</span> <span class="n">m_devices</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">if</span> <span class="p">(</span><span style="color: #aa2211">!</span><span style="color: #aa4000">static_cast</span><span style="color: #aa2211"><</span><span class="n">KWinWaylandTouchpad</span><span style="color: #aa2211">*></span><span class="p">(</span><span class="n">t</span><span class="p">)</span><span style="color: #aa2211">-></span><span class="n">applyConfig</span><span class="p">())</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">success</span> <span style="color: #aa2211">=</span> <span style="color: #304a96">false</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="p">}</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="p">}</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">return</span> <span class="n">success</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><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);">return std::all_of(m_devices.constBegin(), m_devices.constEnd(),
[] (QObject *t) { return static_cast<KWinWaylandTouchpad*>(t)->applyConfig(); });</pre></div></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/D3617#inline-14407" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">kwinwaylandbackend.cpp:118-124</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: #d0ffd0;"> <span style="color: #aa4000">bool</span> <span class="n">success</span> <span style="color: #aa2211">=</span> <span style="color: #304a96">true</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">foreach</span><span class="p">(</span><span class="n">QObject</span> <span style="color: #aa2211">*</span><span class="n">t</span><span class="p">,</span> <span class="n">m_devices</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">if</span> <span class="p">(</span><span style="color: #aa2211">!</span><span style="color: #aa4000">static_cast</span><span style="color: #aa2211"><</span><span class="n">KWinWaylandTouchpad</span><span style="color: #aa2211">*></span><span class="p">(</span><span class="n">t</span><span class="p">)</span><span style="color: #aa2211">-></span><span class="n">getConfig</span><span class="p">())</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">success</span> <span style="color: #aa2211">=</span> <span style="color: #304a96">false</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="p">}</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="p">}</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">return</span> <span class="n">success</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">can also be simplified with algorithm</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/D3617#inline-14408" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">kwinwaylandbackend.cpp:129-135</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: #d0ffd0;"> <span style="color: #aa4000">bool</span> <span class="n">success</span> <span style="color: #aa2211">=</span> <span style="color: #304a96">true</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">foreach</span><span class="p">(</span><span class="n">QObject</span> <span style="color: #aa2211">*</span><span class="n">t</span><span class="p">,</span> <span class="n">m_devices</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">if</span> <span class="p">(</span><span style="color: #aa2211">!</span><span style="color: #aa4000">static_cast</span><span style="color: #aa2211"><</span><span class="n">KWinWaylandTouchpad</span><span style="color: #aa2211">*></span><span class="p">(</span><span class="n">t</span><span class="p">)</span><span style="color: #aa2211">-></span><span class="n">getDefaultConfig</span><span class="p">())</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">success</span> <span style="color: #aa2211">=</span> <span style="color: #304a96">false</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="p">}</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="p">}</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">return</span> <span class="n">success</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">and here as well.</p>
<p style="padding: 0; margin: 8px;">Given that you have three times the same method with just one smallish difference I would even suggest to use a std::function and use one method to rule them all</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/D3617#inline-14409" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">kwinwaylandbackend.cpp:140-144</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: #d0ffd0;"> <span style="color: #aa4000">bool</span> <span class="n">ret</span> <span style="color: #aa2211">=</span> <span style="color: #304a96">false</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">foreach</span><span class="p">(</span><span class="n">QObject</span> <span style="color: #aa2211">*</span><span class="n">q</span><span class="p">,</span> <span class="n">m_devices</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">ret</span> <span style="color: #aa2211">|=</span> <span style="color: #aa4000">static_cast</span><span style="color: #aa2211"><</span><span class="n">KWinWaylandTouchpad</span><span style="color: #aa2211">*></span><span class="p">(</span><span class="n">q</span><span class="p">)</span><span style="color: #aa2211">-></span><span class="n">isChangedConfig</span><span class="p">();</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="p">}</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">return</span> <span class="n">ret</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">std::any_of</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/D3617#inline-14410" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">kwinwaylandbackend.cpp:149-154</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: #d0ffd0;"> <span class="n">foreach</span> <span class="p">(</span><span class="n">QObject</span> <span style="color: #aa2211">*</span><span class="n">d</span><span class="p">,</span> <span class="n">m_devices</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">KWinWaylandTouchpad</span> <span style="color: #aa2211">*</span><span class="n">t</span> <span style="color: #aa2211">=</span> <span style="color: #aa4000">static_cast</span><span style="color: #aa2211"><</span><span class="n">KWinWaylandTouchpad</span><span style="color: #aa2211">*></span><span class="p">(</span><span class="n">d</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">if</span> <span class="p">(</span><span class="n">t</span><span style="color: #aa2211">-></span><span class="n">sysName</span><span class="p">()</span> <span style="color: #aa2211">==</span> <span class="n">sysName</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">return</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="p">}</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="p">}</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">std::find_if</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/D3617#inline-14411" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">kwinwaylandbackend.cpp:187-197</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: #d0ffd0;"><span class="n">QList</span><span style="color: #aa2211"><</span><span class="n">QObject</span><span style="color: #aa2211">*>::</span><span class="n">iterator</span> <span class="n">KWinWaylandBackend</span><span style="color: #aa2211">::</span><span class="n">getDeviceIterator</span><span class="p">(</span><span class="n">QString</span> <span class="n">sysName</span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"><span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">QList</span><span style="color: #aa2211"><</span><span class="n">QObject</span><span style="color: #aa2211">*>::</span><span class="n">iterator</span> <span class="n">it</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">for</span> <span class="p">(</span><span class="n">it</span> <span style="color: #aa2211">=</span> <span class="n">m_devices</span><span class="p">.</span><span class="n">begin</span><span class="p">();</span> <span class="n">it</span> <span style="color: #aa2211">!=</span> <span class="n">m_devices</span><span class="p">.</span><span class="n">end</span><span class="p">();</span> <span style="color: #aa2211">++</span><span class="n">it</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">KWinWaylandTouchpad</span> <span style="color: #aa2211">*</span><span class="n">t</span> <span style="color: #aa2211">=</span> <span style="color: #aa4000">static_cast</span><span style="color: #aa2211"><</span><span class="n">KWinWaylandTouchpad</span><span style="color: #aa2211">*></span><span class="p">(</span><span style="color: #aa2211">*</span><span class="n">it</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">if</span> <span class="p">(</span><span class="n">t</span><span style="color: #aa2211">-></span><span class="n">sysName</span><span class="p">()</span> <span style="color: #aa2211">==</span> <span class="n">sysName</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">return</span> <span class="n">it</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">std::find_if</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/D3617#inline-14406" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">kwinwaylandbackend.h:55</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: #d0ffd0;"> <span class="n">QDBusInterface</span><span style="color: #aa2211">*</span> <span class="n">m_deviceManager</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">QList</span><span style="color: #aa2211"><</span><span class="n">QObject</span><span style="color: #aa2211">*></span> <span class="n">m_devices</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">why is m_devices a list of QObjects and not a list of KWinWaylandTouchpad?</p>
<p style="padding: 0; margin: 8px;">Also: please don't use QList any more in new code, but if possible QVector.</p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R119 Plasma Desktop</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D3617" rel="noreferrer">https://phabricator.kde.org/D3617</a></div></div><br /><div><strong>EMAIL PREFERENCES</strong><div><a href="https://phabricator.kde.org/settings/panel/emailpreferences/" rel="noreferrer">https://phabricator.kde.org/settings/panel/emailpreferences/</a></div></div><br /><div><strong>To: </strong>subdiff, KWin, Plasma on Wayland, Plasma, VDG<br /><strong>Cc: </strong>graesslin, knambiar, kwin, plasma-devel, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, eliasp, sebas<br /></div>