]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Merge branch 'Applications/18.04'
authorKai Uwe Broulik <kde@privat.broulik.de>
Wed, 6 Jun 2018 07:18:17 +0000 (09:18 +0200)
committerKai Uwe Broulik <kde@privat.broulik.de>
Wed, 6 Jun 2018 07:18:17 +0000 (09:18 +0200)
1  2 
src/kitemviews/private/kbaloorolesprovider.cpp

index 3d3923b1b761125c83c6b96ed03ae1a06664344a,6732d08ecb4de6cbc44e6a59c45d8e8ac86ac553..0e9aef71e7728e66c009fea83bfa35d43b04a6e4
@@@ -56,6 -56,9 +56,6 @@@ QHash<QByteArray, QVariant> KBalooRoles
  {
      QHash<QByteArray, QVariant> values;
  
 -    int width = -1;
 -    int height = -1;
 -
      QMapIterator<KFileMetaData::Property::Property, QVariant> it(file.properties());
      while (it.hasNext()) {
          it.next();
  
          const QVariant value = it.value();
  
 -        if (role == "imageSize") {
 -            // Merge the two properties for width and height
 -            // as one string into the "imageSize" role
 -            if (property == QLatin1String("width")) {
 -                width = value.toInt();
 -            }
 -            else if (property == QLatin1String("height")) {
 -                height = value.toInt();
 -            }
 -
 -            if (width >= 0 && height >= 0) {
 -                QString widthAndHeight = QString::number(width);
 -                widthAndHeight += QLatin1String(" x ");
 -                widthAndHeight += QString::number(height);
 -                values.insert(role, widthAndHeight);
 -            }
 -        } else if (role == "orientation") {
 +        if (role == "orientation") {
              const QString orientation = orientationFromValue(value.toInt());
              values.insert(role, orientation);
          } else if (role == "duration") {
@@@ -78,6 -97,8 +78,8 @@@
          } 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());
          }
@@@ -116,7 -137,8 +118,7 @@@ KBalooRolesProvider::KBalooRolesProvide
      };
  
      // Mapping from the URIs to the KFileItemModel roles. Note that this must not be
 -    // a 1:1 mapping: One role may contain several URI-values (e.g. the URIs for height and
 -    // width of an image are mapped to the role "imageSize")
 +    // a 1:1 mapping: One role may contain several URI-values
      static const PropertyInfo propertyInfoList[] = {
          { "rating", "rating" },
          { "tag",        "tags" },
          { "title",         "title" },
          { "wordCount",     "wordCount" },
          { "lineCount",     "lineCount" },
 -        { "width",         "imageSize" },
 -        { "height",        "imageSize" },
 +        { "width",         "width" },
 +        { "height",        "height" },
          { "imageDateTime",   "imageDateTime"},
          { "nexif.orientation", "orientation", },
          { "artist",     "artist" },