<table><tr><td style="">bruns 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/D19087">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/D19087#inline-106996">View Inline</a><span style="color: #4b4d51; font-weight: bold;">astippich</span> wrote in <span style="color: #4b4d51; font-weight: bold;">propertydata.cpp:80</span></div>
<div style="margin: 8px 0; padding: 0 12px; color: #74777D;"><p style="padding: 0; margin: 8px;">Please incorporate support for stringlists.<br />
All clients currently rely on having string lists (or variantlists) as output for multiple entries. It is also what is advertised in KFileMetaData.<br />
None of the clients query for multiple entries in the PropertyMap, Dolphin and Baloo-widgets will break without this for multi-value properties. All of them add and format the output on a per property basis, so querying for multiple keys requires significant changes.<br />
IMHO all extractors should only add one property for each key to the map. If there are duplicate entries, this means that multiple extractors added results (with possible duplication).<br />
Having it as string lists also makes the handling of them so much easier. It can be handled with one call to QVariant::toStringList().join().</p></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p style="padding: 0; margin: 8px;">All clients currently rely on having string lists (<strong>or variantlists</strong>)</p></blockquote>

<p style="padding: 0; margin: 8px;">Actually, string lists make the code more complicated, as the code already has to handle variant lists. There are no <tt style="background: #ebebeb; font-size: 13px;">QDoublelists</tt>, <tt style="background: #ebebeb; font-size: 13px;">QIntlists</tt> ... baloo-widgets treats a <tt style="background: #ebebeb; font-size: 13px;">QVariantList</tt> with string entries exactly like a <tt style="background: #ebebeb; font-size: 13px;">QStringlist</tt>, and dolphin uses baloo-widgets.</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 style="padding: 0; margin: 8px;">It is also what is advertised in KFileMetaData.</p></blockquote>

<p style="padding: 0; margin: 8px;">KFileMetaData does not specify in any way how values for repeated properties are retuned. It explicitly allows calling ExtractionResult::add() with the same property multiple times, but that's it. PropertyMap is just a QMap<> typedef, and does not specify any behavior. For me, it seems much more natural to expect multiple individual entries for the same key, which should be retrieved with QMap::values().</p>

<p style="padding: 0; margin: 8px;">Currently, baloo-widgets (<a href="https://cgit.kde.org/baloo-widgets.git/tree/src/filemetadatawidget.cpp#n152" class="remarkup-link" target="_blank" rel="noreferrer">https://cgit.kde.org/baloo-widgets.git/tree/src/filemetadatawidget.cpp#n152</a>)  only uses <tt style="background: #ebebeb; font-size: 13px;">data[key]</tt>, i.e. it only retrieves the first value, but fixing this is a single line change (i.e. replace <tt style="background: #ebebeb; font-size: 13px;">data[key]</tt> by <tt style="background: #ebebeb; font-size: 13px;">QVariant(data.values(key))</tt>).</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 style="padding: 0; margin: 8px;">Having it as string lists also makes the handling of them so much easier. It can be handled with one call to QVariant::toStringList().join().</p></blockquote>

<p style="padding: 0; margin: 8px;"><tt style="background: #ebebeb; font-size: 13px;">QVariant::toStringList()</tt> also works on <tt style="background: #ebebeb; font-size: 13px;">QVariantLists</tt> - <a href="https://doc.qt.io/qt-5/qvariant.html#toStringList" class="remarkup-link" target="_blank" rel="noreferrer">https://doc.qt.io/qt-5/qvariant.html#toStringList</a></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/D19087#inline-106995">View Inline</a><span style="color: #4b4d51; font-weight: bold;">astippich</span> wrote in <span style="color: #4b4d51; font-weight: bold;">propertydata.cpp:83</span></div>
<div style="margin: 8px 0; padding: 0 12px; color: #74777D;"><p style="padding: 0; margin: 8px;">True, and I said the same quite often in other reviews. But you did not let this count for me either :)<br />
Anyway, not a blocker for me.</p></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Only if it can be fixed it a straight-forward and trivial way, or when it is a regression. This is IMHO not the case here. <br />
Also, PropertyInfo::valueType specifies <tt style="background: #ebebeb; font-size: 13px;">QString</tt> for several properties where multiple values are completely reasonable.</p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R293 Baloo</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D19087">https://phabricator.kde.org/D19087</a></div></div><br /><div><strong>To: </strong>bruns, Baloo, Frameworks, ngraham, poboiko, astippich<br /><strong>Cc: </strong>kde-frameworks-devel, domson, ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams<br /></div>