<table><tr><td style="">dvratil requested changes to this revision.<br />dvratil added a comment.<br />This revision now requires changes to proceed.
</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/D15431">View Revision</a></tr></table><br /><div><div><p>Looks good, just some minor nitpicks.</p>

<hr class="remarkup-hr" />

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>There some ancient compatibility code inside PersonPluginManagerPrivate::loadDataSourcePlugins(), which was added 3 years ago. Apparently, it's not needed anymore.</p></blockquote>

<p>Hard to tell :) We probably shouldn't break backwards compatibility?</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>Inside widgets/CMakeLists.txt, its headers are installed with PREFIX KPeople instead of KPeople/Widgets. Because of that #include <KPeople/Widgets/PersonDetailsView> does not work, because it refers to non-existent header kpeople/persondetailsview.h.</p></blockquote>

<p>Well spotted. I think it's safe to just fix it. It shouldn't break any code, since no code using this would compile atm.</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>In the same file, there is redundant install(FILES [...]), which does not install any file (line 46)</p></blockquote>

<p>I see it on line 48, but indeed looks redundant :)</p>

<p>Technically, all changes to Frameworks should go through review, but if you don't want to upload another Phab diff you can just refer to this review in the commit message.</p></div></div><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/D15431#inline-83447">View Inline</a><span style="color: #4b4d51; font-weight: bold;">personpluginmanager.cpp:103</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="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="n">s_instance</span><span style="color: #aa2211">-></span><span class="n">m_mutex</span><span class="p">.</span><span class="n">lock</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 style="color: #aa2211">!</span><span class="n">s_instance</span><span style="color: #aa2211">-></span><span class="n">dataSourcePlugins</span><span class="p">.</span><span class="n">contains</span><span class="p">(</span><span class="n">sourceId</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;">Use <tt style="background: #ebebeb; font-size: 13px;">QMutexLocker</tt> 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/D15431#inline-83446">View Inline</a><span style="color: #4b4d51; font-weight: bold;">personpluginmanager.cpp:107</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="p">}</span> <span style="color: #aa4000">else</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span class="n">qWarning</span><span class="p">()</span> <span style="color: #aa2211"><<</span> <span style="color: #766510">"Attempting to load data source that is already loaded!"</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;">This may lead to memory leaks since we are transferring ownership into of the <tt style="background: #ebebeb; font-size: 13px;">source</tt> into <tt style="background: #ebebeb; font-size: 13px;">PersonPluginManager</tt>. I would suggest, in case of duplication, to <tt style="background: #ebebeb; font-size: 13px;">deleteLater</tt> the original source and replace it with the new one.</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/D15431#inline-83445">View Inline</a><span style="color: #4b4d51; font-weight: bold;">personpluginmanager.h: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: #74777d">     */</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: #aa4000">static</span> <span style="color: #aa4000">void</span> <span class="n">setLoadSystemDataSourcePlugins</span><span class="p">(</span><span style="color: #aa4000">bool</span> <span class="n">loadSystemDataSourcePlugins</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; ">    <span style="color: #aa4000">static</span> <span class="n">QList</span><span style="color: #aa2211"><</span><span class="n">BasePersonsDataSource</span> <span style="color: #aa2211">*></span> <span class="n">dataSourcePlugins</span><span class="p">();</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">How about <tt style="background: #ebebeb; font-size: 13px;">setAutoloadDataSourcePlugins</tt>? They don't necessarily have to be "system plugins" and we are not preventing them from loading, just from autoloading :)</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/D15431#inline-83444">View Inline</a><span style="color: #4b4d51; font-weight: bold;">personpluginmanager.h:45</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; ">    <span style="color: #aa4000">static</span> <span class="n">QList</span><span style="color: #aa2211"><</span><span class="n">BasePersonsDataSource</span> <span style="color: #aa2211">*></span> <span class="n">dataSourcePlugins</span><span class="p">();</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: #aa4000">static</span> <span style="color: #aa4000">void</span> <span style="color: #004012">setDataSource</span><span class="p">(</span><span style="color: #aa4000">const</span> <span class="n">QString</span> <span style="color: #aa2211">&</span><span class="n">sourceId</span><span class="p">,</span> <span class="n">BasePersonsDataSource</span> <span style="color: #aa2211">*</span><span class="n">source</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; ">    <span style="color: #aa4000">static</span> <span class="n">BasePersonsDataSource</span> <span style="color: #aa2211">*</span><span style="color: #004012">dataSource</span><span class="p">(</span><span style="color: #aa4000">const</span> <span class="n">QString</span> <span style="color: #aa2211">&</span><span class="n">sourceId</span><span class="p">);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">I would call this <tt style="background: #ebebeb; font-size: 13px;">addDataSource</tt>. Also please document that it takes ownership of the <tt style="background: #ebebeb; font-size: 13px;">source</tt>.</p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R307 KPeople</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D15431">https://phabricator.kde.org/D15431</a></div></div><br /><div><strong>To: </strong>poboiko, KDE PIM, dvratil, apol<br /><strong>Cc: </strong>kde-frameworks-devel, michaelh, ngraham, bruns, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss, dvratil<br /></div>