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
Plasma
Plasma Desktop
Commits
0b3d6e55
Commit
0b3d6e55
authored
Apr 02, 2021
by
Nicolas Fella
Browse files
[kcms/keys] Port from KServiceTypeTrader to KApplicationTrader
parent
d9807d36
Changes
1
Hide whitespace changes
Inline
Side-by-side
kcms/keys/globalaccelmodel.cpp
View file @
0b3d6e55
...
...
@@ -21,12 +21,12 @@
#include <QDBusPendingCallWatcher>
#include <QIcon>
#include <KApplicationTrader>
#include <KConfigGroup>
#include <KGlobalAccel>
#include <KGlobalShortcutInfo>
#include <KLocalizedString>
#include <KService>
#include <KServiceTypeTrader>
#include <kglobalaccel_component_interface.h>
#include <kglobalaccel_interface.h>
...
...
@@ -116,8 +116,11 @@ Component GlobalAccelModel::loadComponent(const QList<KGlobalShortcutInfo> &info
if
(
!
service
)
{
// Do we have a service with that name?
const
KService
::
List
services
=
KServiceTypeTrader
::
self
()
->
query
(
QStringLiteral
(
"Application"
),
QStringLiteral
(
"Name == '%1' or Name == '%2'"
).
arg
(
componentUnique
,
componentFriendly
));
auto
filter
=
[
componentUnique
,
componentFriendly
](
const
KService
::
Ptr
service
)
{
return
service
->
name
()
==
componentUnique
||
service
->
name
()
==
componentFriendly
;
};
const
KService
::
List
services
=
KApplicationTrader
::
query
(
filter
);
service
=
services
.
value
(
0
,
KService
::
Ptr
());
}
const
QString
type
=
service
&&
service
->
isApplication
()
?
i18n
(
"Applications"
)
:
i18n
(
"System Services"
);
...
...
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