]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/private/kbaloorolesprovider.cpp
Build TerminalPanel also on Windows
[dolphin.git] / src / kitemviews / private / kbaloorolesprovider.cpp
index d6c15afcdbb42ac5ba0d563d00e5d36cf92cc58b..53fc0b3b9cac1d95540756cdeb4ed706ede102ee 100644 (file)
@@ -26,6 +26,7 @@
 #include <Baloo/File>
 #include <KFileMetaData/PropertyInfo>
 #include <KFileMetaData/UserMetaData>
+#include <KFormat>
 
 #include <QTime>
 #include <QMap>
@@ -95,6 +96,9 @@ QHash<QByteArray, QVariant> KBalooRolesProvider::roleValues(const Baloo::File& f
         } else if (role == "duration") {
             const QString duration = durationFromValue(value.toInt());
             values.insert(role, duration);
+        } else if (role == "bitrate") {
+            const QString bitrate = bitrateFromValue(value.toInt());
+            values.insert(role, bitrate);
         } else {
             values.insert(role, value.toString());
         }
@@ -144,10 +148,14 @@ KBalooRolesProvider::KBalooRolesProvider() :
         { "lineCount",     "lineCount" },
         { "width",         "imageSize" },
         { "height",        "imageSize" },
+        { "imageDateTime",   "imageDateTime"},
         { "nexif.orientation", "orientation", },
         { "artist",     "artist" },
+        { "genre",     "genre"  },
         { "album",    "album" },
         { "duration",      "duration" },
+        { "bitRate", "bitrate" },
+        { "releaseYear",    "releaseYear" },
         { "trackNumber",   "track" },
         { "originUrl", "originUrl" }
     };
@@ -192,3 +200,11 @@ QString KBalooRolesProvider::durationFromValue(int value) const
     return duration.toString(QStringLiteral("hh:mm:ss"));
 }
 
+
+QString KBalooRolesProvider::bitrateFromValue(int value) const
+{
+    KFormat form;
+    QString bitrate = i18nc("@label bitrate (per second)", "%1/s", form.formatByteSize(value, 1, KFormat::MetricBinaryDialect));
+    return bitrate;
+}
+