Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma SDK
Commits
344307f3
Commit
344307f3
authored
Nov 21, 2020
by
Nicolas Fella
Browse files
Port to Plasma::PluginLoader::listDataEngineMetaData
listDataEngineInfo is deprecated
parent
144a90ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
engineexplorer/engineexplorer.cpp
View file @
344307f3
...
...
@@ -18,6 +18,7 @@
#include
<KStringHandler>
#include
<KPluginMetaData>
#include
<KLocalizedString>
#include
<KPluginMetaData>
#include
<QAction>
#include
<QDateTime>
...
...
@@ -139,11 +140,19 @@ void EngineExplorer::dataUpdated(const QString& source, const Plasma::DataEngine
void
EngineExplorer
::
listEngines
()
{
m_engines
->
clear
();
KPluginInfo
::
List
engines
=
m_engineManager
->
listDataEngineInfo
(
m_app
);
std
::
sort
(
engines
.
begin
(),
engines
.
end
());
QVector
<
KPluginMetaData
>
engines
=
m_engineManager
->
listDataEngineMetaData
(
m_app
);
std
::
sort
(
engines
.
begin
(),
engines
.
end
(),
[](
auto
lhs
,
auto
rhs
)
{
if
(
lhs
.
category
()
<
rhs
.
category
())
{
return
true
;
}
if
(
lhs
.
category
()
==
rhs
.
category
())
{
return
lhs
.
name
()
<
rhs
.
name
();
}
return
false
;
});
foreach
(
const
KPlugin
Info
engine
,
engines
)
{
m_engines
->
addItem
(
QIcon
::
fromTheme
(
engine
.
icon
()),
engine
.
plugin
Name
());
foreach
(
const
KPlugin
MetaData
&
engine
,
engines
)
{
m_engines
->
addItem
(
QIcon
::
fromTheme
(
engine
.
icon
Name
()),
engine
.
plugin
Id
());
}
m_engines
->
setCurrentIndex
(
-
1
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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