KFileMetadata: String lists. How do clients cope?
Closed, ResolvedPublic

Description

When kfilemetadata starts to deliver some properties as string lists clients will need to adapt.
A list of components affected, please complete

componentstring list handlingstateresponsiblefuture plans
kfilemetadataall unit tests are against plain strings
kfilemetadata/taglibbroken, puts out strings when there should be stringlistsbetter tests, adapt properties to their correct value types
balooignores stringlists with more than one entrysearching breaks, fixed in D12932@astippich
baloostringlists are retrieved as qvariantlist when loaded from databasetoStringList() works on both, so no harm
baloo widgetsjoin ', 'fixed in Applications 18.12, see D17322, D19106@astippich
elisajoin ', 'submitted
dolphinjoin ', 'D19105@astippich

Order of steps to be taken.

  1. Adapt Baloo - done
  2. Add generic implementation to display strings to KFileMetaData - done
  3. Adapt Baloo-Widgets & Dolphin - done
  4. Finally output QStringLists in KFileMetaData
michaelh created this task.Mar 13 2018, 8:42 AM

The table above is only a rough sketch, please improve.

michaelh renamed this task from KFileMetadata: String lists. How to clients cope? to KFileMetadata: String lists. How do clients cope?.Mar 13 2018, 10:00 AM

Corresponding Elisa task: T8195
I tested a little bit, and using toString in QVariant for a StringList with one entry returns the string, with two or more it results in an empty string. Judging from the code, Baloo succesfully reads StringLists with one entry, but silently fails with more entries. This is the same Elisa is doing before D11340

michaelh added a comment.EditedMar 14 2018, 9:44 PM

Corresponding Elisa task: T8195
I tested a little bit, and using toString in QVariant for a StringList with one entry returns the string, with two or more it results in an empty string.

If you've got a string list use .join(", ") or so, for QVariant::StringList use .toStringList().join().

Judging from the code, Baloo succesfully reads StringLists with one entry, but silently fails with more entries.

Yes. And as far as I understood it parses those token-like items (e.g. subject, keywords) like plain text. Imo it should use them as a whole. E.g. a keyword 'otto' should not be found by the search term 'ott'. But that's only my view.

Nearly forgot: Please complete the list above.

michaelh updated the task description. (Show Details)Mar 14 2018, 9:46 PM
astippich updated the task description. (Show Details)Mar 15 2018, 4:58 PM
astippich updated the task description. (Show Details)

With this multi-value-map pattern in https://phabricator.kde.org/D10694?id=30858 baloo-widgets is having trouble and displays only the first subject.
I'm trying to adapt baloo-widgets, but it is quite difficult and takes a lot of (ugly) code or a major re-write.
In contrast: If kfilemetadata would return string lists the adaption could be done with 2 lines of code. I'll have to look, but my guess is adapting baloo to handle string lists is easier.
Preliminary conclusion: I very much prefer the string list version.

bruns added a subscriber: bruns.Mar 31 2018, 12:57 AM
astippich updated the task description. (Show Details)Dec 2 2018, 7:05 PM
astippich updated the task description. (Show Details)Dec 4 2018, 7:42 PM
astippich updated the task description. (Show Details)Mar 1 2019, 11:40 AM
astippich closed this task as Resolved.Oct 13 2019, 11:41 AM
astippich claimed this task.

Baloo now only outputs multiple entries in the property map instead of stringlist as of D19088 and clients all handle this since Applications 19.08