From: Stefan BrĂ¼ns Date: Sun, 27 Dec 2020 23:51:23 +0000 (+0100) Subject: [BalooRolesProvider] Move static tagsFromValues to anonymous namespace X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/34f74e422661c3b005e98fb11d33c3869c94c7c4 [BalooRolesProvider] Move static tagsFromValues to anonymous namespace --- diff --git a/src/kitemviews/private/kbaloorolesprovider.cpp b/src/kitemviews/private/kbaloorolesprovider.cpp index f2473de3a..f980cbec0 100644 --- a/src/kitemviews/private/kbaloorolesprovider.cpp +++ b/src/kitemviews/private/kbaloorolesprovider.cpp @@ -15,6 +15,17 @@ #include #include +namespace { + QString tagsFromValues(const QStringList& values) + { + 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(QLatin1String(", ")); + } +} + struct KBalooRolesProviderSingleton { KBalooRolesProvider instance; @@ -137,13 +148,6 @@ KBalooRolesProvider::KBalooRolesProvider() : m_roleForProperty.insert(propertyInfoList[i].property, propertyInfoList[i].role); m_roles.insert(propertyInfoList[i].role); } -} -QString KBalooRolesProvider::tagsFromValues(const QStringList& values) const -{ - 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(QLatin1String(", ")); } + diff --git a/src/kitemviews/private/kbaloorolesprovider.h b/src/kitemviews/private/kbaloorolesprovider.h index 99c601e16..8b7bbbafa 100644 --- a/src/kitemviews/private/kbaloorolesprovider.h +++ b/src/kitemviews/private/kbaloorolesprovider.h @@ -47,13 +47,6 @@ public: protected: KBalooRolesProvider(); -private: - /** - * @return User visible string for the given tag-values. - * The tag-values are sorted in alphabetical order. - */ - QString tagsFromValues(const QStringList& values) const; - private: QSet m_roles; QHash m_roleForProperty;