X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/97415005de040885cb63ea01fdb879e20226a2f2..43da84eefc7d:/src/kitemviews/private/kbaloorolesprovider.cpp diff --git a/src/kitemviews/private/kbaloorolesprovider.cpp b/src/kitemviews/private/kbaloorolesprovider.cpp index 9f151df92..d6c15afcd 100644 --- a/src/kitemviews/private/kbaloorolesprovider.cpp +++ b/src/kitemviews/private/kbaloorolesprovider.cpp @@ -29,6 +29,7 @@ #include #include +#include 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")); }