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
PIM
KOrganizer
Commits
5421d42b
Verified
Commit
5421d42b
authored
Jun 16, 2021
by
Alexander Lohnau
💬
Browse files
Use KPluginMetaData to load KCMs in KCMultiDialog
Task:
https://phabricator.kde.org/T14501
parent
d6684c34
Pipeline
#66163
passed with stage
in 13 minutes and 30 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/kodialogmanager.cpp
View file @
5421d42b
...
...
@@ -26,7 +26,11 @@
#include <KCalendarCore/Visitor>
#include <kcmutils_version.h>
#include <KCMultiDialog>
#include <KPluginLoader>
#include <KPluginMetaData>
#include <QPushButton>
using
namespace
KOrg
;
...
...
@@ -73,23 +77,13 @@ void KODialogManager::showOptionsDialog()
qOverload
<
const
QByteArray
&>
(
&
KCMultiDialog
::
configCommitted
),
mMainView
,
qOverload
<
const
QByteArray
&>
(
&
CalendarView
::
updateConfig
));
QStringList
modules
;
modules
.
append
(
QStringLiteral
(
"korganizer_configmain.desktop"
));
modules
.
append
(
QStringLiteral
(
"korganizer_configtime.desktop"
));
modules
.
append
(
QStringLiteral
(
"korganizer_configviews.desktop"
));
modules
.
append
(
QStringLiteral
(
"korganizer_configcolorsandfonts.desktop"
));
modules
.
append
(
QStringLiteral
(
"korganizer_configgroupscheduling.desktop"
));
modules
.
append
(
QStringLiteral
(
"korganizer_configfreebusy.desktop"
));
modules
.
append
(
QStringLiteral
(
"korganizer_configplugins.desktop"
));
modules
.
append
(
QStringLiteral
(
"korganizer_configdesignerfields.desktop"
));
#ifdef WITH_KUSERFEEDBACK
modules
.
append
(
QStringLiteral
(
"korganizer_userfeedback.desktop"
));
const
QVector
<
KPluginMetaData
>
availablePlugins
=
KPluginLoader
::
findPlugins
(
QStringLiteral
(
"pim/kcms/korganizer"
));
for
(
const
KPluginMetaData
&
metaData
:
availablePlugins
)
{
#if KCMUTILS_VERSION >= QT_VERSION_CHECK(5, 84, 0)
mOptionsDialog
->
addModule
(
metaData
);
#else
mOptionsDialog
->
addModule
(
metaData
.
pluginId
());
#endif
// add them all
const
QStringList
::
iterator
mitEnd
(
modules
.
end
());
for
(
QStringList
::
iterator
mit
=
modules
.
begin
();
mit
!=
mitEnd
;
++
mit
)
{
mOptionsDialog
->
addModule
(
*
mit
);
}
}
...
...
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