Verified Commit 222bece2 authored by Alexander Lohnau's avatar Alexander Lohnau
Browse files

Clean up code from imported class

parent 6c6808fa
Pipeline #70026 passed with stage
in 4 minutes and 40 seconds
......@@ -11,8 +11,8 @@ target_sources(kontactprivate PRIVATE
sidepanebase.cpp
iconsidepane.cpp
aboutdialog.cpp
ksettingsdialog/kontactkcmultidialog.cpp
ksettingsdialog/kontactsettingsdialog.cpp
ksettingsdialog/kontactkcmultidialog.cpp
ksettingsdialog/kontactsettingsdialog.cpp
kontactconfiguredialog.cpp
kontact.qrc
)
......
......@@ -16,7 +16,7 @@
using namespace Kontact;
KontactConfigureDialog::KontactConfigureDialog(QWidget *parent)
: KSettings::KontactSettingsDialog(parent)
: KontactSettingsDialog(parent)
{
setFaceType(Tree);
connect(button(QDialogButtonBox::Ok), &QPushButton::clicked, this, &KontactConfigureDialog::slotOk);
......
......@@ -10,7 +10,7 @@
namespace Kontact
{
class KontactConfigureDialog : public KSettings::KontactSettingsDialog
class KontactConfigureDialog : public KontactSettingsDialog
{
Q_OBJECT
......
......@@ -308,7 +308,7 @@ void KontactKCMultiDialogPrivate::apply()
Q_Q(KontactKCMultiDialog);
QStringList updatedComponents;
for (const CreatedModule &module : qAsConst(modules)) {
for (const CreatedModule &module : std::as_const(modules)) {
KCModuleProxy *proxy = module.kcm;
if (proxy->changed()) {
......@@ -327,7 +327,7 @@ void KontactKCMultiDialogPrivate::apply()
}
// Send the configCommitted signal for every updated component.
for (const QString &name : qAsConst(updatedComponents)) {
for (const QString &name : std::as_const(updatedComponents)) {
Q_EMIT q->configCommitted(name.toLatin1());
}
}
......@@ -384,7 +384,7 @@ void KontactKCMultiDialog::closeEvent(QCloseEvent *event)
* in other situations will lead to "module already loaded in Foo," while to the user
* doesn't appear so(the dialog is hidden)
*/
for (auto &proxy : qAsConst(d->modules)) {
for (auto &proxy : std::as_const(d->modules)) {
proxy.kcm->deleteClient();
}
}
......@@ -393,7 +393,7 @@ KPageWidgetItem *KontactKCMultiDialog::addModule(const KPluginMetaData &metaData
{
Q_D(KontactKCMultiDialog);
// Create the scroller
auto *moduleScroll = new UnboundScrollArea(this);
auto moduleScroll = new UnboundScrollArea(this);
// Prepare the scroll area
moduleScroll->setWidgetResizable(true);
moduleScroll->setFrameStyle(QFrame::NoFrame);
......
......@@ -26,8 +26,6 @@
#include "kontact_debug.h"
namespace KSettings
{
KontactSettingsDialog::KontactSettingsDialog(QWidget *parent)
: KontactKCMultiDialog(*new KontactSettingsDialogPrivate(this), new KPageWidget, parent)
{
......@@ -108,6 +106,4 @@ void KontactSettingsDialogPrivate::createDialogFromServices()
});
}
} // namespace
#include "moc_kontactsettingsdialog.cpp"
......@@ -11,13 +11,10 @@
#include "kontactkcmultidialog.h"
namespace KSettings
{
class KontactSettingsDialogPrivate;
class KontactSettingsDialog : public KontactKCMultiDialog
{
friend class PageNode;
Q_DECLARE_PRIVATE(KontactSettingsDialog)
Q_OBJECT
public:
......@@ -35,18 +32,6 @@ protected:
* Reimplemented to lazy create the dialog on first show.
*/
void showEvent(QShowEvent *) override;
Q_SIGNALS:
/**
* If you use the dialog in Configurable mode and want to be notified
* when the user changes the plugin selections use this signal. It's
* emitted if the selection has changed and the user pressed Apply or
* Ok. In the slot you would then load and unload the plugins as
* requested.
*/
void pluginSelectionChanged();
};
}
#endif // KSETTINGS_DIALOG_H
......@@ -21,8 +21,6 @@
#include <KPluginInfo>
#include <KService>
namespace KSettings
{
class KontactSettingsDialogPrivate : public KontactKCMultiDialogPrivate
{
friend class PageNode;
......@@ -46,5 +44,4 @@ private:
void createDialogFromServices();
};
} // namespace KSettings
#endif // KSETTINGS_DIALOG_P_H
......@@ -65,8 +65,6 @@ using namespace Kontact;
#include <QVBoxLayout>
#include <QWebEngineUrlScheme>
#include <ksettings/Dispatcher>
#include <GrantleeTheme/GrantleeTheme>
#include <GrantleeTheme/GrantleeThemeManager>
......@@ -714,7 +712,7 @@ void MainWindow::slotPreferences()
static Kontact::KontactConfigureDialog *dlg = nullptr;
if (!dlg) {
dlg = new Kontact::KontactConfigureDialog(this);
connect(dlg, &KSettings::KontactSettingsDialog::configCommitted, this, [this](const QByteArray &componentName) {
connect(dlg, &KontactSettingsDialog::configCommitted, this, [this](const QByteArray &componentName) {
if (componentName == QByteArrayLiteral("kontact")) {
MainWindow::updateConfig();
}
......@@ -724,7 +722,7 @@ void MainWindow::slotPreferences()
return m1.rawData().value(QStringLiteral("X-KDE-Weight")).toInt() < m2.rawData().value(QStringLiteral("X-KDE-Weight")).toInt();
};
std::sort(mPluginMetaData.begin(), mPluginMetaData.end(), sortByWeight);
for (const KPluginMetaData &metaData : qAsConst(mPluginMetaData)) {
for (const KPluginMetaData &metaData : std::as_const(mPluginMetaData)) {
const QString pluginNamespace = metaData.value(QStringLiteral("X-KDE-ConfigModuleNamespace"));
if (!pluginNamespace.isEmpty()) {
auto plugins = KPluginLoader::findPlugins(pluginNamespace);
......@@ -732,7 +730,6 @@ void MainWindow::slotPreferences()
dlg->addPluginComponent(metaData, plugins);
}
}
connect(dlg, &Kontact::KontactConfigureDialog::pluginSelectionChanged, this, &MainWindow::pluginsChanged);
}
dlg->show();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment