Verified Commit 6c6808fa authored by Alexander Lohnau's avatar Alexander Lohnau
Browse files

Rename imported classes to kontact specific names

Otherwise tha names would class with the existing ones from KCMUtils
parent 7dc7713e
......@@ -11,8 +11,8 @@ target_sources(kontactprivate PRIVATE
sidepanebase.cpp
iconsidepane.cpp
aboutdialog.cpp
ksettingsdialog/kcmultidialog.cpp
ksettingsdialog/dialog.cpp
ksettingsdialog/kontactkcmultidialog.cpp
ksettingsdialog/kontactsettingsdialog.cpp
kontactconfiguredialog.cpp
kontact.qrc
)
......
......@@ -16,7 +16,7 @@
using namespace Kontact;
KontactConfigureDialog::KontactConfigureDialog(QWidget *parent)
: KSettings::Dialog(parent)
: KSettings::KontactSettingsDialog(parent)
{
setFaceType(Tree);
connect(button(QDialogButtonBox::Ok), &QPushButton::clicked, this, &KontactConfigureDialog::slotOk);
......
......@@ -6,11 +6,11 @@
#pragma once
#include "ksettingsdialog/dialog.h"
#include "ksettingsdialog/kontactsettingsdialog.h"
namespace Kontact
{
class KontactConfigureDialog : public KSettings::Dialog
class KontactConfigureDialog : public KSettings::KontactSettingsDialog
{
Q_OBJECT
......
......@@ -9,8 +9,8 @@
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include "kcmultidialog.h"
#include "kcmultidialog_p.h"
#include "kontactkcmultidialog.h"
#include "kontactkcmultidialog_p.h"
#include "kcmoduleproxy.h"
......@@ -33,9 +33,9 @@
#include <KPageWidgetModel>
#include <KPluginMetaData>
bool KCMultiDialogPrivate::resolveChanges(KCModuleProxy *currentProxy)
bool KontactKCMultiDialogPrivate::resolveChanges(KCModuleProxy *currentProxy)
{
Q_Q(KCMultiDialog);
Q_Q(KontactKCMultiDialog);
if (!currentProxy || !currentProxy->changed()) {
return true;
}
......@@ -66,9 +66,9 @@ bool KCMultiDialogPrivate::resolveChanges(KCModuleProxy *currentProxy)
}
}
void KCMultiDialogPrivate::_k_slotCurrentPageChanged(KPageWidgetItem *current, KPageWidgetItem *previous)
void KontactKCMultiDialogPrivate::_k_slotCurrentPageChanged(KPageWidgetItem *current, KPageWidgetItem *previous)
{
Q_Q(KCMultiDialog);
Q_Q(KontactKCMultiDialog);
KCModuleProxy *previousModule = nullptr;
for (int i = 0; i < modules.count(); ++i) {
......@@ -110,9 +110,9 @@ void KCMultiDialogPrivate::_k_slotCurrentPageChanged(KPageWidgetItem *current, K
_k_clientChanged();
}
void KCMultiDialogPrivate::_k_clientChanged()
void KontactKCMultiDialogPrivate::_k_clientChanged()
{
Q_Q(KCMultiDialog);
Q_Q(KontactKCMultiDialog);
// qDebug();
// Get the current module
KCModuleProxy *activeModule = nullptr;
......@@ -131,20 +131,20 @@ void KCMultiDialogPrivate::_k_clientChanged()
QPushButton *applyButton = q->buttonBox()->button(QDialogButtonBox::Apply);
if (applyButton) {
q->disconnect(applyButton, &QAbstractButton::clicked, q, &KCMultiDialog::slotApplyClicked);
q->disconnect(applyButton, &QAbstractButton::clicked, q, &KontactKCMultiDialog::slotApplyClicked);
}
QPushButton *okButton = q->buttonBox()->button(QDialogButtonBox::Ok);
if (okButton) {
q->disconnect(okButton, &QAbstractButton::clicked, q, &KCMultiDialog::slotOkClicked);
q->disconnect(okButton, &QAbstractButton::clicked, q, &KontactKCMultiDialog::slotOkClicked);
}
if (applyButton) {
q->connect(applyButton, &QAbstractButton::clicked, q, &KCMultiDialog::slotApplyClicked);
q->connect(applyButton, &QAbstractButton::clicked, q, &KontactKCMultiDialog::slotApplyClicked);
}
if (okButton) {
q->connect(okButton, &QAbstractButton::clicked, q, &KCMultiDialog::slotOkClicked);
q->connect(okButton, &QAbstractButton::clicked, q, &KontactKCMultiDialog::slotOkClicked);
}
}
......@@ -189,9 +189,9 @@ void KCMultiDialogPrivate::_k_clientChanged()
}
}
void KCMultiDialogPrivate::init()
void KontactKCMultiDialogPrivate::init()
{
Q_Q(KCMultiDialog);
Q_Q(KontactKCMultiDialog);
q->setFaceType(KPageDialog::Auto);
q->setWindowTitle(i18n("Configure"));
q->setModal(false);
......@@ -210,11 +210,11 @@ void KCMultiDialogPrivate::init()
buttonBox->button(QDialogButtonBox::Reset)->setEnabled(false);
buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
q->connect(buttonBox->button(QDialogButtonBox::Apply), &QAbstractButton::clicked, q, &KCMultiDialog::slotApplyClicked);
q->connect(buttonBox->button(QDialogButtonBox::Ok), &QAbstractButton::clicked, q, &KCMultiDialog::slotOkClicked);
q->connect(buttonBox->button(QDialogButtonBox::RestoreDefaults), &QAbstractButton::clicked, q, &KCMultiDialog::slotDefaultClicked);
q->connect(buttonBox->button(QDialogButtonBox::Help), &QAbstractButton::clicked, q, &KCMultiDialog::slotHelpClicked);
q->connect(buttonBox->button(QDialogButtonBox::Reset), &QAbstractButton::clicked, q, &KCMultiDialog::slotUser1Clicked);
q->connect(buttonBox->button(QDialogButtonBox::Apply), &QAbstractButton::clicked, q, &KontactKCMultiDialog::slotApplyClicked);
q->connect(buttonBox->button(QDialogButtonBox::Ok), &QAbstractButton::clicked, q, &KontactKCMultiDialog::slotOkClicked);
q->connect(buttonBox->button(QDialogButtonBox::RestoreDefaults), &QAbstractButton::clicked, q, &KontactKCMultiDialog::slotDefaultClicked);
q->connect(buttonBox->button(QDialogButtonBox::Help), &QAbstractButton::clicked, q, &KontactKCMultiDialog::slotHelpClicked);
q->connect(buttonBox->button(QDialogButtonBox::Reset), &QAbstractButton::clicked, q, &KontactKCMultiDialog::slotUser1Clicked);
q->setButtonBox(buttonBox);
q->connect(q, &KPageDialog::currentPageChanged, q, [this](KPageWidgetItem *current, KPageWidgetItem *before) {
......@@ -222,26 +222,26 @@ void KCMultiDialogPrivate::init()
});
}
KCMultiDialog::KCMultiDialog(QWidget *parent)
KontactKCMultiDialog::KontactKCMultiDialog(QWidget *parent)
: KPageDialog(parent)
, d_ptr(new KCMultiDialogPrivate(this))
, d_ptr(new KontactKCMultiDialogPrivate(this))
{
d_func()->init();
}
KCMultiDialog::KCMultiDialog(KCMultiDialogPrivate &dd, KPageWidget *pageWidget, QWidget *parent, Qt::WindowFlags flags)
KontactKCMultiDialog::KontactKCMultiDialog(KontactKCMultiDialogPrivate &dd, KPageWidget *pageWidget, QWidget *parent, Qt::WindowFlags flags)
: KPageDialog(pageWidget, parent, flags)
, d_ptr(&dd)
{
d_func()->init();
}
KCMultiDialog::~KCMultiDialog()
KontactKCMultiDialog::~KontactKCMultiDialog()
{
delete d_ptr;
}
void KCMultiDialog::showEvent(QShowEvent *ev)
void KontactKCMultiDialog::showEvent(QShowEvent *ev)
{
KPageDialog::showEvent(ev);
adjustSize();
......@@ -259,9 +259,9 @@ void KCMultiDialog::showEvent(QShowEvent *ev)
}
}
void KCMultiDialog::slotDefaultClicked()
void KontactKCMultiDialog::slotDefaultClicked()
{
Q_D(KCMultiDialog);
Q_D(KontactKCMultiDialog);
const KPageWidgetItem *item = currentPage();
if (!item) {
return;
......@@ -276,14 +276,14 @@ void KCMultiDialog::slotDefaultClicked()
}
}
void KCMultiDialog::slotUser1Clicked()
void KontactKCMultiDialog::slotUser1Clicked()
{
const KPageWidgetItem *item = currentPage();
if (!item) {
return;
}
Q_D(KCMultiDialog);
Q_D(KontactKCMultiDialog);
for (int i = 0; i < d->modules.count(); ++i) {
if (d->modules[i].item == item) {
d->modules[i].kcm->load();
......@@ -293,7 +293,7 @@ void KCMultiDialog::slotUser1Clicked()
}
}
bool KCMultiDialogPrivate::moduleSave(KCModuleProxy *module)
bool KontactKCMultiDialogPrivate::moduleSave(KCModuleProxy *module)
{
if (!module) {
return false;
......@@ -303,9 +303,9 @@ bool KCMultiDialogPrivate::moduleSave(KCModuleProxy *module)
return true;
}
void KCMultiDialogPrivate::apply()
void KontactKCMultiDialogPrivate::apply()
{
Q_Q(KCMultiDialog);
Q_Q(KontactKCMultiDialog);
QStringList updatedComponents;
for (const CreatedModule &module : qAsConst(modules)) {
......@@ -332,7 +332,7 @@ void KCMultiDialogPrivate::apply()
}
}
void KCMultiDialog::slotApplyClicked()
void KontactKCMultiDialog::slotApplyClicked()
{
QPushButton *applyButton = buttonBox()->button(QDialogButtonBox::Apply);
applyButton->setFocus();
......@@ -340,7 +340,7 @@ void KCMultiDialog::slotApplyClicked()
d_func()->apply();
}
void KCMultiDialog::slotOkClicked()
void KontactKCMultiDialog::slotOkClicked()
{
QPushButton *okButton = buttonBox()->button(QDialogButtonBox::Ok);
okButton->setFocus();
......@@ -349,14 +349,14 @@ void KCMultiDialog::slotOkClicked()
accept();
}
void KCMultiDialog::slotHelpClicked()
void KontactKCMultiDialog::slotHelpClicked()
{
const KPageWidgetItem *item = currentPage();
if (!item) {
return;
}
Q_D(KCMultiDialog);
Q_D(KontactKCMultiDialog);
QString docPath;
for (int i = 0; i < d->modules.count(); ++i) {
if (d->modules[i].item == item) {
......@@ -374,9 +374,9 @@ void KCMultiDialog::slotHelpClicked()
}
}
void KCMultiDialog::closeEvent(QCloseEvent *event)
void KontactKCMultiDialog::closeEvent(QCloseEvent *event)
{
Q_D(KCMultiDialog);
Q_D(KontactKCMultiDialog);
KPageDialog::closeEvent(event);
/**
......@@ -389,9 +389,9 @@ void KCMultiDialog::closeEvent(QCloseEvent *event)
}
}
KPageWidgetItem *KCMultiDialog::addModule(const KPluginMetaData &metaData, KPageWidgetItem *parent)
KPageWidgetItem *KontactKCMultiDialog::addModule(const KPluginMetaData &metaData, KPageWidgetItem *parent)
{
Q_D(KCMultiDialog);
Q_D(KontactKCMultiDialog);
// Create the scroller
auto *moduleScroll = new UnboundScrollArea(this);
// Prepare the scroll area
......@@ -404,7 +404,7 @@ KPageWidgetItem *KCMultiDialog::addModule(const KPluginMetaData &metaData, KPage
auto item = new KPageWidgetItem(moduleScroll, metaData.name());
KCMultiDialogPrivate::CreatedModule createdModule;
KontactKCMultiDialogPrivate::CreatedModule createdModule;
createdModule.kcm = kcm;
createdModule.item = item;
d->modules.append(createdModule);
......@@ -440,4 +440,4 @@ KPageWidgetItem *KCMultiDialog::addModule(const KPluginMetaData &metaData, KPage
return item;
}
#include "moc_kcmultidialog.cpp"
#include "moc_kontactkcmultidialog.cpp"
......@@ -7,8 +7,8 @@
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef KCMULTIDIALOG_H
#define KCMULTIDIALOG_H
#ifndef KONTACTKCMULTIDIALOG_H
#define KONTACTKCMULTIDIALOG_H
#include <QScrollArea>
#include <QScrollBar>
......@@ -16,7 +16,7 @@
#include <KPageDialog>
#include <KPluginMetaData>
class KCMultiDialogPrivate;
class KontactKCMultiDialogPrivate;
/**
* @short A class that offers a KPageDialog containing arbitrary
......@@ -24,14 +24,14 @@ class KCMultiDialogPrivate;
*
* @author Matthias Elter <elter@kde.org>, Daniel Molkentin <molkentin@kde.org>
*/
class KCMultiDialog : public KPageDialog
class KontactKCMultiDialog : public KPageDialog
{
Q_OBJECT
Q_DECLARE_PRIVATE(KCMultiDialog)
Q_DECLARE_PRIVATE(KontactKCMultiDialog)
public:
explicit KCMultiDialog(QWidget *parent = nullptr);
~KCMultiDialog() override;
explicit KontactKCMultiDialog(QWidget *parent = nullptr);
~KontactKCMultiDialog() override;
/**
* Add a module to the dialog. Its position will be determined based on the @c X-KDE-Weight value.
......@@ -62,9 +62,9 @@ protected:
/**
* This constructor can be used by subclasses to provide a custom KPageWidget.
*/
KCMultiDialog(KCMultiDialogPrivate &dd, KPageWidget *pageWidget, QWidget *parent, Qt::WindowFlags flags = Qt::WindowFlags());
KontactKCMultiDialog(KontactKCMultiDialogPrivate &dd, KPageWidget *pageWidget, QWidget *parent, Qt::WindowFlags flags = Qt::WindowFlags());
KCMultiDialogPrivate *const d_ptr;
KontactKCMultiDialogPrivate *const d_ptr;
void closeEvent(QCloseEvent *event) override;
void showEvent(QShowEvent *event) override;
......
......@@ -6,26 +6,26 @@
SPDX-License-Identifier: LGPL-2.0-only
*/
#ifndef KCMULTIDIALOG_P_H
#define KCMULTIDIALOG_P_H
#ifndef KONTACTKCMULTIDIALOG_P_H
#define KONTACTKCMULTIDIALOG_P_H
#include "kcmultidialog.h"
#include "kontactkcmultidialog.h"
#include <QList>
#include <QStringList>
class KCModuleProxy;
class KPageWidgetItem;
class KCMultiDialogPrivate
class KontactKCMultiDialogPrivate
{
Q_DECLARE_PUBLIC(KCMultiDialog)
Q_DECLARE_PUBLIC(KontactKCMultiDialog)
protected:
KCMultiDialogPrivate(KCMultiDialog *parent)
KontactKCMultiDialogPrivate(KontactKCMultiDialog *parent)
: q_ptr(parent)
{
}
virtual ~KCMultiDialogPrivate()
virtual ~KontactKCMultiDialogPrivate()
{
}
......@@ -44,7 +44,7 @@ protected:
virtual void _k_clientChanged();
void _k_dialogClosed();
KCMultiDialog *const q_ptr;
KontactKCMultiDialog *const q_ptr;
private:
void init();
......@@ -53,4 +53,4 @@ private:
bool moduleSave(KCModuleProxy *module);
};
#endif // KCMULTIDIALOG_P_H
#endif // KONTACTKCMULTIDIALOG_P_H
......@@ -6,8 +6,8 @@
SPDX-License-Identifier: LGPL-2.0-only
*/
#include "dialog.h"
#include "dialog_p.h"
#include "kontactsettingsdialog.h"
#include "kontactsettingsdialog_p.h"
#include <KConfig>
#include <KLocalizedString>
......@@ -28,24 +28,24 @@
namespace KSettings
{
Dialog::Dialog(QWidget *parent)
: KCMultiDialog(*new DialogPrivate(this), new KPageWidget, parent)
KontactSettingsDialog::KontactSettingsDialog(QWidget *parent)
: KontactKCMultiDialog(*new KontactSettingsDialogPrivate(this), new KPageWidget, parent)
{
}
Dialog::~Dialog()
KontactSettingsDialog::~KontactSettingsDialog()
{
}
void Dialog::addPluginComponent(const KPluginMetaData &parentPluginMetaData, const QVector<KPluginMetaData> &pluginMetaData)
void KontactSettingsDialog::addPluginComponent(const KPluginMetaData &parentPluginMetaData, const QVector<KPluginMetaData> &pluginMetaData)
{
Q_D(Dialog);
Q_D(KontactSettingsDialog);
d->componentsMetaData.append({parentPluginMetaData, pluginMetaData});
}
void Dialog::showEvent(QShowEvent *)
void KontactSettingsDialog::showEvent(QShowEvent *)
{
Q_D(Dialog);
Q_D(KontactSettingsDialog);
if (d->firstshow) {
setUpdatesEnabled(false);
d->createDialogFromServices();
......@@ -54,14 +54,14 @@ void Dialog::showEvent(QShowEvent *)
}
}
DialogPrivate::DialogPrivate(Dialog *parent)
: KCMultiDialogPrivate(parent)
KontactSettingsDialogPrivate::KontactSettingsDialogPrivate(KontactSettingsDialog *parent)
: KontactKCMultiDialogPrivate(parent)
{
}
KPageWidgetItem *DialogPrivate::createPageItem(KPageWidgetItem *parentItem, const QString &name, const QString &comment, const QString &iconName)
KPageWidgetItem *KontactSettingsDialogPrivate::createPageItem(KPageWidgetItem *parentItem, const QString &name, const QString &comment, const QString &iconName)
{
Q_Q(Dialog);
Q_Q(KontactSettingsDialog);
auto page = new QWidget(q);
auto iconLabel = new QLabel(page);
......@@ -88,9 +88,9 @@ KPageWidgetItem *DialogPrivate::createPageItem(KPageWidgetItem *parentItem, cons
return (item);
}
void DialogPrivate::createDialogFromServices()
void KontactSettingsDialogPrivate::createDialogFromServices()
{
Q_Q(Dialog);
Q_Q(KontactSettingsDialog);
for (const auto &pair : std::as_const(componentsMetaData)) {
const KPluginMetaData &parentComponentMetaData = pair.first;
......@@ -102,7 +102,7 @@ void DialogPrivate::createDialogFromServices()
}
}
QObject::connect(q, QOverload<const QByteArray &>::of(&KCMultiDialog::configCommitted), q, [](const QByteArray &componentName) {
QObject::connect(q, QOverload<const QByteArray &>::of(&KontactKCMultiDialog::configCommitted), q, [](const QByteArray &componentName) {
KSharedConfig::Ptr config = KSharedConfig::openConfig(QString::fromLatin1(componentName) + QLatin1String("rc"));
config->reparseConfiguration();
});
......@@ -110,4 +110,4 @@ void DialogPrivate::createDialogFromServices()
} // namespace
#include "moc_dialog.cpp"
#include "moc_kontactsettingsdialog.cpp"
......@@ -9,21 +9,21 @@
#ifndef KSETTINGS_DIALOG_H
#define KSETTINGS_DIALOG_H
#include "./kcmultidialog.h"
#include "kontactkcmultidialog.h"
namespace KSettings
{
class DialogPrivate;
class KontactSettingsDialogPrivate;
class Dialog : public KCMultiDialog
class KontactSettingsDialog : public KontactKCMultiDialog
{
friend class PageNode;
Q_DECLARE_PRIVATE(Dialog)
Q_DECLARE_PRIVATE(KontactSettingsDialog)
Q_OBJECT
public:
explicit Dialog(QWidget *parent = nullptr);
explicit KontactSettingsDialog(QWidget *parent = nullptr);
~Dialog() override;
~KontactSettingsDialog() override;
/**
* Adds a page with parentPluginMetaData used for title & icon of the component page and pluginMetaData for it's subpages
......
......@@ -9,9 +9,9 @@
#ifndef KSETTINGS_DIALOG_P_H
#define KSETTINGS_DIALOG_P_H
#include "dialog.h"
#include "kcmoduleinfo.h"
#include "kcmultidialog_p.h"
#include "kontactkcmultidialog_p.h"
#include "kontactsettingsdialog.h"
#include <QHash>
#include <QSet>
......@@ -23,12 +23,12 @@
namespace KSettings
{
class DialogPrivate : public KCMultiDialogPrivate
class KontactSettingsDialogPrivate : public KontactKCMultiDialogPrivate
{
friend class PageNode;
Q_DECLARE_PUBLIC(Dialog)
Q_DECLARE_PUBLIC(KontactSettingsDialog)
protected:
DialogPrivate(Dialog *parent);
KontactSettingsDialogPrivate(KontactSettingsDialog *parent);
QStringList registeredComponents;
QList<QPair<KPluginMetaData, QVector<KPluginMetaData>>> componentsMetaData;
......
......@@ -714,7 +714,7 @@ void MainWindow::slotPreferences()
static Kontact::KontactConfigureDialog *dlg = nullptr;
if (!dlg) {
dlg = new Kontact::KontactConfigureDialog(this);
connect(dlg, &KSettings::Dialog::configCommitted, this, [this](const QByteArray &componentName) {
connect(dlg, &KSettings::KontactSettingsDialog::configCommitted, this, [this](const QByteArray &componentName) {
if (componentName == QByteArrayLiteral("kontact")) {
MainWindow::updateConfig();
}
......
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