mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-17 15:31:20 +00:00
[BalooRolesProvider] Move static tagsFromValues to anonymous namespace
This commit is contained in:
parent
4c31ec3789
commit
34f74e4226
|
@ -15,6 +15,17 @@
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
|
|
||||||
|
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
|
struct KBalooRolesProviderSingleton
|
||||||
{
|
{
|
||||||
KBalooRolesProvider instance;
|
KBalooRolesProvider instance;
|
||||||
|
@ -137,13 +148,6 @@ KBalooRolesProvider::KBalooRolesProvider() :
|
||||||
m_roleForProperty.insert(propertyInfoList[i].property, propertyInfoList[i].role);
|
m_roleForProperty.insert(propertyInfoList[i].property, propertyInfoList[i].role);
|
||||||
m_roles.insert(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(", "));
|
|
||||||
}
|
|
||||||
|
|
|
@ -47,13 +47,6 @@ public:
|
||||||
protected:
|
protected:
|
||||||
KBalooRolesProvider();
|
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:
|
private:
|
||||||
QSet<QByteArray> m_roles;
|
QSet<QByteArray> m_roles;
|
||||||
QHash<QString, QByteArray> m_roleForProperty;
|
QHash<QString, QByteArray> m_roleForProperty;
|
||||||
|
|
Loading…
Reference in a new issue