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
KMail
Commits
7769b79e
Verified
Commit
7769b79e
authored
Jun 16, 2021
by
Alexander Lohnau
💬
Browse files
ConfigureDialog: Use KPluginMetaData to load KCMs
parent
b17e8c23
Pipeline
#66197
passed with stage
in 24 minutes and 18 seconds
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
src/configuredialog/configuredialog.cpp
View file @
7769b79e
...
...
@@ -15,6 +15,10 @@
#include "kmkernel.h"
#include "settings/kmailsettings.h"
#include <kcmutils_version.h>
#include <KPluginLoader>
#include <KPluginMetaData>
#include <QPushButton>
ConfigureDialog
::
ConfigureDialog
(
QWidget
*
parent
,
bool
modal
)
...
...
@@ -24,12 +28,15 @@ ConfigureDialog::ConfigureDialog(QWidget *parent, bool modal)
setStandardButtons
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Help
|
QDialogButtonBox
::
RestoreDefaults
|
QDialogButtonBox
::
Cancel
|
QDialogButtonBox
::
Apply
|
QDialogButtonBox
::
Reset
);
setModal
(
modal
);
addModule
(
QStringLiteral
(
"kmail_config_accounts"
));
addModule
(
QStringLiteral
(
"kmail_config_appearance"
));
addModule
(
QStringLiteral
(
"kmail_config_composer"
));
addModule
(
QStringLiteral
(
"kmail_config_security"
));
addModule
(
QStringLiteral
(
"kmail_config_misc"
));
addModule
(
QStringLiteral
(
"kmail_config_plugins"
));
const
QVector
<
KPluginMetaData
>
availablePlugins
=
KPluginLoader
::
findPlugins
(
QStringLiteral
(
"pim/kcms/kmail"
));
for
(
const
KPluginMetaData
&
metaData
:
availablePlugins
)
{
#if KCMUTILS_VERSION >= QT_VERSION_CHECK(5, 84, 0)
addModule
(
metaData
);
#else
addModule
(
metaData
.
pluginId
());
#endif
}
connect
(
button
(
QDialogButtonBox
::
Ok
),
&
QPushButton
::
clicked
,
this
,
&
ConfigureDialog
::
slotOk
);
connect
(
button
(
QDialogButtonBox
::
Apply
),
&
QPushButton
::
clicked
,
this
,
&
ConfigureDialog
::
slotApply
);
...
...
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