Commit e90b4891 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Adapt to new api

parent 46d0dc24
......@@ -37,7 +37,7 @@ AutomaticAddContactsConfigureDialog::~AutomaticAddContactsConfigureDialog()
QWidget *AutomaticAddContactsConfigureDialog::createLayout()
{
mConfigureWidget = new AutomaticAddContactsConfigureWidget(KIdentityManagement::IdentityManager::self(), this);
mConfigureWidget = new AutomaticAddContactsConfigureWidget(this);
return mConfigureWidget;
}
......
......@@ -27,7 +27,7 @@
#include <KIdentityManagement/IdentityManager>
#include <KIdentityManagement/Identity>
AutomaticAddContactsConfigureTab::AutomaticAddContactsConfigureTab(KIdentityManagement::IdentityManager *identityManagement, QWidget *parent)
AutomaticAddContactsConfigureTab::AutomaticAddContactsConfigureTab(QWidget *parent)
: QWidget(parent)
{
QHBoxLayout *mainLayout = new QHBoxLayout(this);
......@@ -36,7 +36,7 @@ AutomaticAddContactsConfigureTab::AutomaticAddContactsConfigureTab(KIdentityMana
mTabWidget = new QTabWidget(this);
mTabWidget->setObjectName(QStringLiteral("tabwidget"));
mainLayout->addWidget(mTabWidget);
initTab(identityManagement);
initTab(KIdentityManagement::IdentityManager::self());
}
AutomaticAddContactsConfigureTab::~AutomaticAddContactsConfigureTab()
......@@ -46,11 +46,6 @@ AutomaticAddContactsConfigureTab::~AutomaticAddContactsConfigureTab()
void AutomaticAddContactsConfigureTab::initTab(KIdentityManagement::IdentityManager *identityManager)
{
bool needToDeleteIdentity = false;
if (!identityManager) {
needToDeleteIdentity = true;
identityManager = new KIdentityManagement::IdentityManager(true);
}
KIdentityManagement::IdentityManager::ConstIterator end = identityManager->end();
for (KIdentityManagement::IdentityManager::ConstIterator it = identityManager->begin(); it != end; ++it) {
AutomaticAddContactsTabWidget *w = new AutomaticAddContactsTabWidget(this);
......@@ -59,10 +54,6 @@ void AutomaticAddContactsConfigureTab::initTab(KIdentityManagement::IdentityMana
w->setIdentity((*it).uoid());
mListTabWidget.append(w);
}
if (needToDeleteIdentity) {
delete identityManager;
identityManager = Q_NULLPTR;
}
}
void AutomaticAddContactsConfigureTab::loadSettings()
......
......@@ -34,7 +34,7 @@ class AutomaticAddContactsConfigureTab : public QWidget
{
Q_OBJECT
public:
explicit AutomaticAddContactsConfigureTab(KIdentityManagement::IdentityManager *identityManagement, QWidget *parent = Q_NULLPTR);
explicit AutomaticAddContactsConfigureTab(QWidget *parent = Q_NULLPTR);
~AutomaticAddContactsConfigureTab();
void loadSettings();
......
......@@ -29,14 +29,14 @@
#include <KConfigGroup>
#include <KSharedConfig>
AutomaticAddContactsConfigureWidget::AutomaticAddContactsConfigureWidget(KIdentityManagement::IdentityManager *im, QWidget *parent)
: MessageComposer::PluginEditorCheckBeforeSendConfigureWidget(im, parent)
AutomaticAddContactsConfigureWidget::AutomaticAddContactsConfigureWidget(QWidget *parent)
: MessageComposer::PluginEditorCheckBeforeSendConfigureWidget(parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setMargin(0);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mConfigureTab = new AutomaticAddContactsConfigureTab(identityManager(), this);
mConfigureTab = new AutomaticAddContactsConfigureTab(this);
mConfigureTab->setObjectName(QStringLiteral("configuretab"));
mainLayout->addWidget(mConfigureTab);
connect(mConfigureTab, &AutomaticAddContactsConfigureTab::configureChanged, this, &AutomaticAddContactsConfigureWidget::configureChanged);
......
......@@ -27,7 +27,7 @@ class AutomaticAddContactsConfigureWidget : public MessageComposer::PluginEditor
{
Q_OBJECT
public:
explicit AutomaticAddContactsConfigureWidget(KIdentityManagement::IdentityManager *im, QWidget *parent = Q_NULLPTR);
explicit AutomaticAddContactsConfigureWidget(QWidget *parent = Q_NULLPTR);
~AutomaticAddContactsConfigureWidget();
void loadSettings() Q_DECL_OVERRIDE;
......
......@@ -19,7 +19,6 @@
#include "checkbeforesendconfiguredialog.h"
#include "checkbeforesendconfigurewidget.h"
#include <KIdentityManagement/IdentityManager>
#include <KLocalizedString>
CheckBeforeSendConfigureDialog::CheckBeforeSendConfigureDialog(QWidget *parent)
......@@ -36,7 +35,7 @@ CheckBeforeSendConfigureDialog::~CheckBeforeSendConfigureDialog()
QWidget *CheckBeforeSendConfigureDialog::createLayout()
{
mConfigureWidget = new CheckBeforeSendConfigureWidget(KIdentityManagement::IdentityManager::self(), this);
mConfigureWidget = new CheckBeforeSendConfigureWidget(this);
return mConfigureWidget;
}
......
......@@ -24,8 +24,8 @@
#include <KConfigGroup>
#include <KSharedConfig>
CheckBeforeSendConfigureWidget::CheckBeforeSendConfigureWidget(KIdentityManagement::IdentityManager *identityManager, QWidget *parent)
: MessageComposer::PluginEditorCheckBeforeSendConfigureWidget(identityManager, parent)
CheckBeforeSendConfigureWidget::CheckBeforeSendConfigureWidget(QWidget *parent)
: MessageComposer::PluginEditorCheckBeforeSendConfigureWidget(parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setMargin(0);
......
......@@ -28,7 +28,7 @@ class CheckBeforeSendConfigureWidget : public MessageComposer::PluginEditorCheck
{
Q_OBJECT
public:
explicit CheckBeforeSendConfigureWidget(KIdentityManagement::IdentityManager *identityManager, QWidget *parent = Q_NULLPTR);
explicit CheckBeforeSendConfigureWidget(QWidget *parent = Q_NULLPTR);
~CheckBeforeSendConfigureWidget();
void loadSettings() Q_DECL_OVERRIDE;
......
......@@ -37,7 +37,7 @@ ConfirmAddressConfigureDialog::~ConfirmAddressConfigureDialog()
QWidget *ConfirmAddressConfigureDialog::createLayout()
{
mConfigureWidget = new ConfirmAddressConfigureWidget(KIdentityManagement::IdentityManager::self(), this);
mConfigureWidget = new ConfirmAddressConfigureWidget(this);
return mConfigureWidget;
}
......
......@@ -24,7 +24,7 @@
#include <KIdentityManagement/IdentityManager>
#include <KIdentityManagement/Identity>
ConfirmAddressConfigureTab::ConfirmAddressConfigureTab(KIdentityManagement::IdentityManager *identityManagement, QWidget *parent)
ConfirmAddressConfigureTab::ConfirmAddressConfigureTab(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout(this);
......@@ -35,7 +35,7 @@ ConfirmAddressConfigureTab::ConfirmAddressConfigureTab(KIdentityManagement::Iden
mTabWidget->setObjectName(QStringLiteral("tabwidget"));
mainLayout->addWidget(mTabWidget);
initTab(identityManagement);
initTab(KIdentityManagement::IdentityManager::self());
}
ConfirmAddressConfigureTab::~ConfirmAddressConfigureTab()
......
......@@ -33,7 +33,7 @@ class ConfirmAddressConfigureTab : public QWidget
{
Q_OBJECT
public:
explicit ConfirmAddressConfigureTab(KIdentityManagement::IdentityManager *identityManagement, QWidget *parent = Q_NULLPTR);
explicit ConfirmAddressConfigureTab(QWidget *parent = Q_NULLPTR);
~ConfirmAddressConfigureTab();
void loadSettings(const KConfigGroup &grp);
......
......@@ -26,8 +26,8 @@
#include <KSharedConfig>
#include <QRegularExpression>
ConfirmAddressConfigureWidget::ConfirmAddressConfigureWidget(KIdentityManagement::IdentityManager *im, QWidget *parent)
: MessageComposer::PluginEditorCheckBeforeSendConfigureWidget(im, parent)
ConfirmAddressConfigureWidget::ConfirmAddressConfigureWidget(QWidget *parent)
: MessageComposer::PluginEditorCheckBeforeSendConfigureWidget(parent)
{
QVBoxLayout *vboxlayout = new QVBoxLayout(this);
vboxlayout->setMargin(0);
......@@ -37,7 +37,7 @@ ConfirmAddressConfigureWidget::ConfirmAddressConfigureWidget(KIdentityManagement
vboxlayout->addWidget(mEnable);
connect(mEnable, &QCheckBox::clicked, this, &ConfirmAddressConfigureWidget::slotEnableChanged);
mConfirmAddressConfigureTab = new ConfirmAddressConfigureTab(identityManager(), this);
mConfirmAddressConfigureTab = new ConfirmAddressConfigureTab(this);
mConfirmAddressConfigureTab->setObjectName(QStringLiteral("confirmaddresstab"));
connect(mConfirmAddressConfigureTab, &ConfirmAddressConfigureTab::configureChanged, this, &ConfirmAddressConfigureWidget::configureChanged);
vboxlayout->addWidget(mConfirmAddressConfigureTab);
......
......@@ -28,7 +28,7 @@ class ConfirmAddressConfigureWidget : public MessageComposer::PluginEditorCheckB
{
Q_OBJECT
public:
explicit ConfirmAddressConfigureWidget(KIdentityManagement::IdentityManager *im, QWidget *parent = Q_NULLPTR);
explicit ConfirmAddressConfigureWidget(QWidget *parent = Q_NULLPTR);
~ConfirmAddressConfigureWidget();
void loadSettings() Q_DECL_OVERRIDE;
......
Supports Markdown
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