Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
System
Dolphin
Commits
34f74e42
Commit
34f74e42
authored
Dec 28, 2020
by
Stefan Brüns
Browse files
[BalooRolesProvider] Move static tagsFromValues to anonymous namespace
parent
4c31ec37
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/kitemviews/private/kbaloorolesprovider.cpp
View file @
34f74e42
...
...
@@ -15,6 +15,17 @@
#include <QDebug>
#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
{
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
(
", "
));
}
src/kitemviews/private/kbaloorolesprovider.h
View file @
34f74e42
...
...
@@ -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
<
QByteArray
>
m_roles
;
QHash
<
QString
,
QByteArray
>
m_roleForProperty
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment