Handle properties with multiple values
AbandonedPublic

Authored by astippich on Mar 30 2018, 8:30 PM.

Details

Reviewers
michaelh
Group Reviewers
Baloo
Frameworks
Summary

Depends on D10694

Test Plan

make test

Diff Detail

Repository
R824 Baloo Widgets
Branch
string-list (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
michaelh created this revision.Mar 30 2018, 8:30 PM
Restricted Application added a project: Baloo. · View Herald TranscriptMar 30 2018, 8:30 PM
michaelh requested review of this revision.Mar 30 2018, 8:30 PM
michaelh edited the summary of this revision. (Show Details)

Sorry for the late answer. Isn't this already handled in widgetfactory.cpp toString function (line 87)? During my testing with multiple values I've never had issues with baloo-widgets, only with baloo itself. If there are still changes required in baloo-widgets, I think they should happen inside the toString() function.

michaelh planned changes to this revision.Apr 15 2018, 12:05 PM

Due to a bug in calligra test.odt file is broken. see D11971.

michaelh added a comment.EditedApr 15 2018, 12:22 PM

Sorry for the late answer. Isn't this already handled in widgetfactory.cpp toString function (line 87)? During my testing with multiple values I've never had issues with baloo-widgets, only with baloo itself.

Have you tried autotests/samplefiles/multi/*.* of D12197? For me baloo-widgets mostly displays only one author or keyword. Also...

A QMap can store multiple values for one key, and a client reading the Map can use QMap::values() to get a list of all matching properties. If a client naively uses value() instead, it just gets the first value for the key, but so be it.

If there are still changes required in baloo-widgets, I think they should happen inside the toString() function.

That could be done in toString(). The concatenation is only an intermediate step. The real plan is to use TagWidget for e.g. keywords, genres and so on, in that case I would have to move all the decision making back to where it is now.

Seems to work just fine, see screenshot:

I did a little bit more testing, and in case you didn't already know: It looks like baloo outputs properties with multiple values as a QVariantList (QList<QVariant>), and hence baloo-widgets with its test for QVariant::List should work just fine. I tested this with Elisa and the values we get from baloo. But baloo doesn't work with lists as input. Luckily, QVariant::toStringList() works both with QStringList and QVariantList. I will work on a solution that accepts stringlists as an input for baloo. That should allow to solve the issues with all the property types in KFileMetaData. As it looks right now, there is a difference if one queries the properties via baloo (QVariantList) or directly via KFileMetaData (multiple entries with a single string).

If there are still changes required in baloo-widgets, I think they should happen inside the toString() function.

That could be done in toString(). The concatenation is only an intermediate step. The real plan is to use TagWidget for e.g. keywords, genres and so on, in that case I would have to move all the decision making back to where it is now.

If it's only intermediary, then it's probably fine. Maybe add a comment.

Surprising!
master


patch

astippich commandeered this revision.May 3 2019, 4:27 PM
astippich abandoned this revision.
astippich added a reviewer: michaelh.