<table><tr><td style="">apol 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/D13503">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/D13503#inline-70584">View Inline</a><span style="color: #4b4d51; font-weight: bold;">remotecommandsmodel.cpp:122</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">beginInsertRows</span><span class="p">(</span><span class="n">QModelIndex</span><span class="p">(),</span> <span style="color: #601200">0</span><span class="p">,</span> <span class="n">commandIds</span><span class="p">.</span><span class="n">size</span><span class="p">()</span> <span style="color: #aa2211">-</span> <span style="color: #601200">1</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: #aa4000">for</span> <span class="p">(</span><span style="color: #aa4000">const</span> <span class="n">QString</span><span style="color: #aa2211">&</span> <span style="color: #a0a000">commandId</span> <span class="p">:</span> <span class="n">commandIds</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 it maybe be beginResetModel? Looks like we're setting it up from scratch. Then we'd need to m_commandList.clear()</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/D13503#inline-70586">View Inline</a><span style="color: #4b4d51; font-weight: bold;">remotecommandsmodel.cpp:167</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">int</span> <span class="n">row</span> <span style="color: #aa2211">=</span> <span class="n">index</span><span class="p">.</span><span class="n">row</span><span class="p">();</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: #aa4000">if</span> <span class="p">(</span><span class="n">row</span> <span style="color: #aa2211"><</span> <span style="color: #601200">0</span> <span style="color: #aa2211">||</span> <span class="n">row</span> <span style="color: #aa2211">>=</span> <span class="n">m_commandList</span><span class="p">.</span><span class="n">size</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/D13503#inline-70585">View Inline</a><span style="color: #4b4d51; font-weight: bold;">remotecommandsmodel.cpp:168</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">int</span> <span class="n">row</span> <span style="color: #aa2211">=</span> <span class="n">index</span><span class="p">.</span><span class="n">row</span><span class="p">();</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: #aa4000">if</span> <span class="p">(</span><span class="n">row</span> <span style="color: #aa2211"><</span> <span style="color: #601200">0</span> <span style="color: #aa2211">||</span> <span class="n">row</span> <span style="color: #aa2211">>=</span> <span class="n">m_commandList</span><span class="p">.</span><span class="n">size</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 style="color: #aa4000">return</span> <span style="color: #aa4000">nullptr</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">No need to check bounds if we call m_commendList.value(row);</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/D13503#inline-70579">View Inline</a><span style="color: #4b4d51; font-weight: bold;">remotecommandsmodel.h:31</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">class</span> <span class="n">KDECONNECTINTERFACES_EXPORT</span> <span style="color: #a0a000">RemotecommandsModel</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="p">:</span> <span class="n">public</span> <span class="n">QAbstractListModel</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Should be <tt style="background: #ebebeb; font-size: 13px;">RemoteCommandsModel</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/D13503#inline-70580">View Inline</a><span style="color: #4b4d51; font-weight: bold;">remotecommandsmodel.h:70</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">DeviceRemotecommandsDbusInterface</span><span style="color: #aa2211">*</span> <span class="n">m_dbusInterface</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="n">QList</span><span style="color: #aa2211"><</span><span class="n">RemotecommandDbusInterface</span><span style="color: #aa2211">*></span> <span class="n">m_commandList</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="n">QString</span> <span class="n">m_deviceId</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">QVector</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/D13503#inline-70587">View Inline</a><span style="color: #4b4d51; font-weight: bold;">remotecommand.h:21</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(251, 175, 175, .7);"><span style="color: #304a96">#<span class="bright">ifndef REMOTECOMMANDSPLUGIN_H</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);"><span style="color: #304a96">#define REMOTECOMMANDSPLUGIN_H</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #304a96">#<span class="bright">pragma once</span></span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Don't do that just here once</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/D13503#inline-70592">View Inline</a><span style="color: #4b4d51; font-weight: bold;">remotecommand.h:30</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(251, 175, 175, .7);">    <span class="n">Q_CLASSINFO</span><span class="p">(</span><span style="color: #766510">"D-Bus Interface"</span><span class="p">,</span> <span style="color: #766510">"org.kde.kdeconnect.device.remotecommands"</span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">    <span class="n">Q_PROPERTY</span><span class="p">(</span><span class="n">Q<span class="bright">ByteArray</span></span><span class="bright"> </span><span class="n"><span class="bright">commands</span></span><span class="bright"> </span><span class="n">READ</span> <span class="bright"></span><span class="n"><span class="bright">commands</span></span><span class="bright"> </span><span class="n"><span class="bright">NOTIFY</span></span><span class="bright"> </span><span class="n"><span class="bright">commandsChanged</span></span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="n">Q_CLASSINFO</span><span class="p">(</span><span style="color: #766510">"D-Bus Interface"</span><span class="p">,</span> <span style="color: #766510">"org.kde.kdeconnect.device.remotecommands<span class="bright">.remotecommand</span>"</span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="n">Q_PROPERTY</span><span class="p">(</span><span class="n">Q<span class="bright">String</span></span><span class="bright"> </span><span class="n"><span class="bright">key</span></span><span class="bright"> </span><span class="n">READ</span> <span class="bright"></span><span class="n"><span class="bright">key</span></span><span class="bright"> </span><span class="n"><span class="bright">CONSTANT</span></span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="n">Q_PROPERTY</span><span class="p">(</span><span class="n">QString</span> <span class="n">name</span> <span class="n">READ</span> <span class="n">name</span> <span class="n">CONSTANT</span><span class="p">)</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Wouldn't it make sense to just return a QVariantMap or QJsonObject? Creating a dbus interface just to make it constant doesn't make a lot of sense.</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/D13503#inline-70593">View Inline</a><span style="color: #4b4d51; font-weight: bold;">remotecommandsdbusinterface.h:48</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(251, 175, 175, .7);"><span class="bright">    </span><span class="n"><span class="bright">QString</span></span><span class="bright"> </span><span style="color: #004012"><span class="bright">dbusPath</span></span><span class="bright"></span><span class="p"><span class="bright">()</span></span><span class="bright"> </span><span style="color: #aa4000"><span class="bright">const</span></span><span class="bright"> </span><span class="n"><span class="bright">override</span></span><span class="bright"></span><span class="p"><span class="bright">;</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: #aa4000">bool</span> <span style="color: #004012">receivePacket</span><span class="p">(</span><span style="color: #aa4000">const</span> <span class="n">NetworkPacket</span><span style="color: #aa2211">&</span> <span class="n">np</span><span class="p">);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Why does a dbus interface have a <tt style="background: #ebebeb; font-size: 13px;">receivePacket</tt>?<br />
I'd say it's better to leave it as it was with setCommands and commands.</p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R224 KDE Connect</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D13503">https://phabricator.kde.org/D13503</a></div></div><br /><div><strong>To: </strong>nicolasfella, KDE Connect<br /><strong>Cc: </strong>apol, kdeconnect, KDE Connect, jdvr, yannux, Danial0_0, johnq, Pitel, adeen-s, SemperPeritus, ndavis, daniel.z.tg, jeanv, seebauer, bugzy, MayeulC, menasshock, ach<br /></div>