Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Plasma Desktop
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dan Leinir Turthra Jensen
Plasma Desktop
Commits
10b8ad92
Commit
10b8ad92
authored
Jun 19, 2020
by
Alexander Lohnau
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Runners KCM: Send DBus signal when config has changed
parent
25ee470d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
kcms/runners/kcm.cpp
kcms/runners/kcm.cpp
+22
-0
No files found.
kcms/runners/kcm.cpp
View file @
10b8ad92
...
...
@@ -31,6 +31,9 @@
#include <KPluginSelector>
#include <QApplication>
#include <QDBusMessage>
#include <QDBusConnection>
#include <QDBusMetaType>
#include <QVBoxLayout>
#include <QLabel>
#include <QDialog>
...
...
@@ -78,6 +81,18 @@ SearchConfigModule::SearchConfigModule(QWidget* parent, const QVariantList& args
connect
(
m_pluginSelector
,
&
KPluginSelector
::
changed
,
this
,
[
this
]
{
markAsChanged
();
});
connect
(
m_pluginSelector
,
&
KPluginSelector
::
defaulted
,
this
,
&
KCModule
::
defaulted
);
qDBusRegisterMetaType
<
QByteArrayList
>
();
qDBusRegisterMetaType
<
QHash
<
QString
,
QByteArrayList
>>
();
// This will trigger the reloadConfiguration method for the runner
connect
(
m_pluginSelector
,
&
KPluginSelector
::
configCommitted
,
this
,
[](
const
QByteArray
&
componentName
){
QDBusMessage
message
=
QDBusMessage
::
createSignal
(
QStringLiteral
(
"/krunnerrc"
),
QStringLiteral
(
"org.kde.kconfig.notify"
),
QStringLiteral
(
"ConfigChanged"
));
const
QHash
<
QString
,
QByteArrayList
>
changes
=
{{
QStringLiteral
(
"Runners"
),
{
componentName
}}};
message
.
setArguments
({
QVariant
::
fromValue
(
changes
)});
QDBusConnection
::
sessionBus
().
send
(
message
);
});
layout
->
addLayout
(
headerLayout
);
layout
->
addWidget
(
m_pluginSelector
);
}
...
...
@@ -102,6 +117,13 @@ void SearchConfigModule::load()
void
SearchConfigModule
::
save
()
{
m_pluginSelector
->
save
();
QDBusMessage
message
=
QDBusMessage
::
createSignal
(
QStringLiteral
(
"/krunnerrc"
),
QStringLiteral
(
"org.kde.kconfig.notify"
),
QStringLiteral
(
"ConfigChanged"
));
const
QHash
<
QString
,
QByteArrayList
>
changes
=
{{
QStringLiteral
(
"Plugins"
),
{}}};
message
.
setArguments
({
QVariant
::
fromValue
(
changes
)});
QDBusConnection
::
sessionBus
().
send
(
message
);
}
void
SearchConfigModule
::
defaults
()
...
...
Write
Preview
Markdown
is supported
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