]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/private/kbaloorolesprovider.cpp
Correct searchbox, split view transitions between tabs
[dolphin.git] / src / kitemviews / private / kbaloorolesprovider.cpp
index 9f151df92ab91dc84687aa4339bf90acf507d2c7..d6c15afcdbb42ac5ba0d563d00e5d36cf92cc58b 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <QTime>
 #include <QMap>
+#include <QCollator>
 
 struct KBalooRolesProviderSingleton
 {
@@ -159,7 +160,11 @@ KBalooRolesProvider::KBalooRolesProvider() :
 
 QString KBalooRolesProvider::tagsFromValues(const QStringList& values) const
 {
-    return values.join(QStringLiteral(", "));
+    QStringList alphabeticalOrderTags = values;
+    QCollator coll;
+    coll.setNumericMode(true);
+    std::sort(alphabeticalOrderTags.begin(), alphabeticalOrderTags.end(), [&](const QString& s1, const QString& s2){ return coll.compare(s1, s2) < 0; });
+    return alphabeticalOrderTags.join(QStringLiteral(", "));
 }
 
 QString KBalooRolesProvider::orientationFromValue(int value) const
@@ -182,7 +187,7 @@ QString KBalooRolesProvider::orientationFromValue(int value) const
 
 QString KBalooRolesProvider::durationFromValue(int value) const
 {
-    QTime duration;
+    QTime duration(0, 0, 0);
     duration = duration.addSecs(value);
     return duration.toString(QStringLiteral("hh:mm:ss"));
 }