]> cloud.milkyroute.net Git - dolphin.git/commitdiff
[KBalooRolesProvider] Support properties of type QStringList
authorKai Uwe Broulik <kde@privat.broulik.de>
Wed, 6 Jun 2018 07:17:07 +0000 (09:17 +0200)
committerKai Uwe Broulik <kde@privat.broulik.de>
Wed, 6 Jun 2018 07:17:07 +0000 (09:17 +0200)
QVariant::toString() unwraps a QStringList with a single string to a QString, however a list with multiple entries returns a null string.
Explicitly check for KFileMetaData property type and convert accordingly.

BUG: 395033
FIXED-IN: 18.04.3

Differential Revision: https://phabricator.kde.org/D13349

src/kitemviews/private/kbaloorolesprovider.cpp

index bbd0927f21ef639f9371e568d2e9083ffce63651..6732d08ecb4de6cbc44e6a59c45d8e8ac86ac553 100644 (file)
@@ -97,6 +97,8 @@ QHash<QByteArray, QVariant> KBalooRolesProvider::roleValues(const Baloo::File& f
         } else if (role == "bitrate") {
             const QString bitrate = bitrateFromValue(value.toInt());
             values.insert(role, bitrate);
+        } else if (pi.valueType() == QVariant::StringList) {
+            values.insert(role, value.toStringList().join(QStringLiteral(", ")));
         } else {
             values.insert(role, value.toString());
         }