Commit bcc0e5e8 authored by Krzysztof Nowicki's avatar Krzysztof Nowicki
Browse files

EWS: Rename files to make them unique across the tree

parent 708fd641
......@@ -61,8 +61,8 @@ set(ewsresource_SRCS
task/ewsfetchtaskdetailjob.cpp
task/ewsmodifytaskjob.cpp
task/ewstaskhandler.cpp
configdialog.cpp
ewsautodiscoveryjob.cpp
ewsconfigdialog.cpp
ewscreateitemjob.cpp
ewsfetchfoldersjob.cpp
ewsfetchfoldersincrjob.cpp
......@@ -71,12 +71,12 @@ set(ewsresource_SRCS
ewsitemhandler.cpp
ewsmodifyitemjob.cpp
ewsmodifyitemflagsjob.cpp
ewsprogressdialog.cpp
ewsresource.cpp
ewssettings.cpp
ewssubscribedfoldersjob.cpp
ewssubscriptionmanager.cpp
ewssubscriptionwidget.cpp
progressdialog.cpp
settings.cpp)
ewssubscriptionwidget.cpp)
ecm_qt_declare_logging_category(ewsresource_SRCS
HEADER ewsres_debug.h
......@@ -88,21 +88,21 @@ ecm_qt_declare_logging_category(ewsresource_SRCS
CATEGORY_NAME org.kde.pim.ews.agentif)
ki18n_wrap_ui(ewsresource_SRCS configdialog.ui)
ki18n_wrap_ui(ewsresource_SRCS ewsconfigdialog.ui)
kconfig_add_kcfg_files(ewsresource_SRCS settingsbase.kcfgc)
kconfig_add_kcfg_files(ewsresource_SRCS ewssettingsbase.kcfgc)
kcfg_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/ewsresource.kcfg org.kde.Akonadi.Ews.Settings)
qt5_add_dbus_adaptor(ewsresource_SRCS
${CMAKE_CURRENT_BINARY_DIR}/org.kde.Akonadi.Ews.Settings.xml settings.h Settings
${CMAKE_CURRENT_BINARY_DIR}/org.kde.Akonadi.Ews.Settings.xml ewssettings.h EwsSettings ewssettingsadaptor EwsSettingsAdaptor
)
qt5_generate_dbus_interface( ${CMAKE_CURRENT_SOURCE_DIR}/ewsresource.h org.kde.Akonadi.Ews.Resource.xml OPTIONS -a )
qt5_add_dbus_adaptor(ewsresource_SRCS
${CMAKE_CURRENT_BINARY_DIR}/org.kde.Akonadi.Ews.Resource.xml ewsresource.h EwsResource
${CMAKE_CURRENT_BINARY_DIR}/org.kde.Akonadi.Ews.Resource.xml ewsresource.h EwsResource ewsresourceadaptor EwsResourceAdaptor
)
qt5_generate_dbus_interface( ${CMAKE_CURRENT_SOURCE_DIR}/settings.h org.kde.Akonadi.Ews.Wallet.xml OPTIONS -a )
qt5_generate_dbus_interface( ${CMAKE_CURRENT_SOURCE_DIR}/ewssettings.h org.kde.Akonadi.Ews.Wallet.xml OPTIONS -a )
qt5_add_dbus_adaptor(ewsresource_SRCS
${CMAKE_CURRENT_BINARY_DIR}/org.kde.Akonadi.Ews.Wallet.xml settings.h Settings
${CMAKE_CURRENT_BINARY_DIR}/org.kde.Akonadi.Ews.Wallet.xml ewssettings.h EwsSettings ewswalletadaptor EwsWalletAdaptor
)
......@@ -125,17 +125,17 @@ target_link_libraries(akonadi_ews_resource
if (HAVE_SEPARATE_MTA_RESOURCE)
set(ewsmtaresource_SRCS
ewsmtaresource.cpp
mtaconfigdialog.cpp)
ewsmtaconfigdialog.cpp
ewsmtaresource.cpp)
ki18n_wrap_ui(ewsmtaresource_SRCS mtaconfigdialog.ui)
ki18n_wrap_ui(ewsmtaresource_SRCS ewsmtaconfigdialog.ui)
kconfig_add_kcfg_files(ewsmtaresource_SRCS mtasettings.kcfgc)
kconfig_add_kcfg_files(ewsmtaresource_SRCS ewsmtasettings.kcfgc)
kcfg_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/ewsmtaresource.kcfg org.kde.Akonadi.EwsMta.Settings)
qt5_add_dbus_adaptor(ewsmtaresource_SRCS
${CMAKE_CURRENT_BINARY_DIR}/org.kde.Akonadi.EwsMta.Settings.xml mtasettings.h MtaSettings mtasettingsadaptor
${CMAKE_CURRENT_BINARY_DIR}/org.kde.Akonadi.EwsMta.Settings.xml ewsmtasettings.h EwsMtaSettings ewsmtasettingsadaptor
)
qt5_add_dbus_interface(ewsmtaresource_SRCS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.Akonadi.Ews.Resource.xml resourceinterface)
qt5_add_dbus_interface(ewsmtaresource_SRCS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.Akonadi.Ews.Resource.xml ewsresourceinterface)
add_executable(akonadi_ewsmta_resource ${ewsmtaresource_SRCS})
target_link_libraries(akonadi_ewsmta_resource
......
......@@ -17,7 +17,7 @@
Boston, MA 02110-1301, USA.
*/
#include "configdialog.h"
#include "ewsconfigdialog.h"
#include <KConfigDialogManager>
#include <KWindowSystem>
......@@ -28,13 +28,13 @@
#include <QPushButton>
#include "ui_configdialog.h"
#include "settings.h"
#include "ewsresource.h"
#include "ewsautodiscoveryjob.h"
#include "ewsgetfolderrequest.h"
#include "progressdialog.h"
#include "ewsresource.h"
#include "ewssettings.h"
#include "ewssubscriptionwidget.h"
#include "ewsprogressdialog.h"
#include "ui_configdialog.h"
typedef QPair<QString, QString> StringPair;
......@@ -48,7 +48,7 @@ static const QVector<StringPair> userAgents = {
{QStringLiteral("Mozilla Thunderbird 38 for Mac (with ExQuilla)"), QStringLiteral("Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:38.0) Gecko/20100101 Thunderbird/38.2.0")}
};
ConfigDialog::ConfigDialog(EwsResource *parentResource, EwsClient &client, WId wId)
EwsConfigDialog::EwsConfigDialog(EwsResource *parentResource, EwsClient &client, WId wId)
: QDialog()
, mParentResource(parentResource)
{
......@@ -64,8 +64,8 @@ ConfigDialog::ConfigDialog(EwsResource *parentResource, EwsClient &client, WId w
QPushButton *okButton = mButtonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(mButtonBox, &QDialogButtonBox::accepted, this, &ConfigDialog::dialogAccepted);
connect(mButtonBox, &QDialogButtonBox::rejected, this, &ConfigDialog::reject);
connect(mButtonBox, &QDialogButtonBox::accepted, this, &EwsConfigDialog::dialogAccepted);
connect(mButtonBox, &QDialogButtonBox::rejected, this, &EwsConfigDialog::reject);
mainLayout->addWidget(mButtonBox);
setWindowTitle(i18n("Microsoft Exchange Configuration"));
......@@ -131,28 +131,28 @@ ConfigDialog::ConfigDialog(EwsResource *parentResource, EwsClient &client, WId w
mUi->aboutLicenseLabel->setText(i18nc("@info", "Distributed under the GNU Library General Public License version 2.0 or later."));
mUi->aboutUrlLabel->setText(QStringLiteral("<a href=\"https://github.com/KrissN/akonadi-ews\">https://github.com/KrissN/akonadi-ews</a>"));
connect(okButton, &QPushButton::clicked, this, &ConfigDialog::save);
connect(mUi->autodiscoverButton, &QPushButton::clicked, this, &ConfigDialog::performAutoDiscovery);
connect(mUi->kcfg_Username, &KLineEdit::textChanged, this, &ConfigDialog::setAutoDiscoveryNeeded);
connect(mUi->passwordEdit, &KPasswordLineEdit::passwordChanged, this, &ConfigDialog::setAutoDiscoveryNeeded);
connect(mUi->kcfg_Domain, &KLineEdit::textChanged, this, &ConfigDialog::setAutoDiscoveryNeeded);
connect(mUi->kcfg_HasDomain, &QCheckBox::toggled, this, &ConfigDialog::setAutoDiscoveryNeeded);
connect(mUi->kcfg_Email, &KLineEdit::textChanged, this, &ConfigDialog::setAutoDiscoveryNeeded);
connect(mUi->kcfg_BaseUrl, &KLineEdit::textChanged, this, &ConfigDialog::enableTryConnect);
connect(mUi->tryConnectButton, &QPushButton::clicked, this, &ConfigDialog::tryConnect);
connect(mUi->userAgentCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ConfigDialog::userAgentChanged);
connect(okButton, &QPushButton::clicked, this, &EwsConfigDialog::save);
connect(mUi->autodiscoverButton, &QPushButton::clicked, this, &EwsConfigDialog::performAutoDiscovery);
connect(mUi->kcfg_Username, &KLineEdit::textChanged, this, &EwsConfigDialog::setAutoDiscoveryNeeded);
connect(mUi->passwordEdit, &KPasswordLineEdit::passwordChanged, this, &EwsConfigDialog::setAutoDiscoveryNeeded);
connect(mUi->kcfg_Domain, &KLineEdit::textChanged, this, &EwsConfigDialog::setAutoDiscoveryNeeded);
connect(mUi->kcfg_HasDomain, &QCheckBox::toggled, this, &EwsConfigDialog::setAutoDiscoveryNeeded);
connect(mUi->kcfg_Email, &KLineEdit::textChanged, this, &EwsConfigDialog::setAutoDiscoveryNeeded);
connect(mUi->kcfg_BaseUrl, &KLineEdit::textChanged, this, &EwsConfigDialog::enableTryConnect);
connect(mUi->tryConnectButton, &QPushButton::clicked, this, &EwsConfigDialog::tryConnect);
connect(mUi->userAgentCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EwsConfigDialog::userAgentChanged);
connect(mUi->clearFolderTreeSyncStateButton, &QPushButton::clicked, mParentResource,
&EwsResource::clearFolderTreeSyncState);
connect(mUi->clearFolderItemSyncStateButton, &QPushButton::clicked, mParentResource,
static_cast<void (EwsResource::*)()>(&EwsResource::clearFolderSyncState));
}
ConfigDialog::~ConfigDialog()
EwsConfigDialog::~EwsConfigDialog()
{
delete mUi;
}
void ConfigDialog::save()
void EwsConfigDialog::save()
{
mParentResource->setName(mUi->accountName->text());
mConfigManager->updateSettings();
......@@ -185,20 +185,20 @@ void ConfigDialog::save()
mParentResource->settings()->save();
}
void ConfigDialog::performAutoDiscovery()
void EwsConfigDialog::performAutoDiscovery()
{
mAutoDiscoveryJob = new EwsAutodiscoveryJob(mUi->kcfg_Email->text(),
fullUsername(), mUi->passwordEdit->password(),
mUi->userAgentGroupBox->isEnabled() ? mUi->userAgentEdit->text() : QString(),
mUi->kcfg_EnableNTLMv2->isChecked(), this);
connect(mAutoDiscoveryJob, &EwsAutodiscoveryJob::result, this, &ConfigDialog::autoDiscoveryFinished);
mProgressDialog = new ProgressDialog(this, ProgressDialog::AutoDiscovery);
connect(mProgressDialog, &QDialog::rejected, this, &ConfigDialog::autoDiscoveryCancelled);
connect(mAutoDiscoveryJob, &EwsAutodiscoveryJob::result, this, &EwsConfigDialog::autoDiscoveryFinished);
mProgressDialog = new EwsProgressDialog(this, EwsProgressDialog::AutoDiscovery);
connect(mProgressDialog, &QDialog::rejected, this, &EwsConfigDialog::autoDiscoveryCancelled);
mAutoDiscoveryJob->start();
mProgressDialog->show();
}
void ConfigDialog::autoDiscoveryFinished(KJob *job)
void EwsConfigDialog::autoDiscoveryFinished(KJob *job)
{
if (job->error() || job != mAutoDiscoveryJob) {
KMessageBox::error(this, job->errorText(), i18nc("Exchange server autodiscovery", "Autodiscovery failed"));
......@@ -213,7 +213,7 @@ void ConfigDialog::autoDiscoveryFinished(KJob *job)
mProgressDialog = nullptr;
}
void ConfigDialog::tryConnectFinished(KJob *job)
void EwsConfigDialog::tryConnectFinished(KJob *job)
{
if (job->error() || job != mTryConnectJob) {
KMessageBox::error(this, job->errorText(), i18nc("Exchange server connection", "Connection failed"));
......@@ -231,7 +231,7 @@ void ConfigDialog::tryConnectFinished(KJob *job)
mProgressDialog = nullptr;
}
void ConfigDialog::autoDiscoveryCancelled()
void EwsConfigDialog::autoDiscoveryCancelled()
{
if (mAutoDiscoveryJob) {
mAutoDiscoveryJob->kill();
......@@ -240,7 +240,7 @@ void ConfigDialog::autoDiscoveryCancelled()
mProgressDialog = nullptr;
}
void ConfigDialog::tryConnectCancelled()
void EwsConfigDialog::tryConnectCancelled()
{
if (mTryConnectJob) {
mTryConnectJob->kill();
......@@ -249,7 +249,7 @@ void ConfigDialog::tryConnectCancelled()
mTryConnectJob = nullptr;
}
void ConfigDialog::setAutoDiscoveryNeeded()
void EwsConfigDialog::setAutoDiscoveryNeeded()
{
mAutoDiscoveryNeeded = true;
mTryConnectNeeded = true;
......@@ -263,7 +263,7 @@ void ConfigDialog::setAutoDiscoveryNeeded()
mButtonBox->button(QDialogButtonBox::Ok)->setEnabled(okEnabled);
}
QString ConfigDialog::fullUsername() const
QString EwsConfigDialog::fullUsername() const
{
QString username = mUi->kcfg_Username->text();
if (mUi->kcfg_HasDomain->isChecked()) {
......@@ -272,16 +272,16 @@ QString ConfigDialog::fullUsername() const
return username;
}
void ConfigDialog::dialogAccepted()
void EwsConfigDialog::dialogAccepted()
{
if (mUi->kcfg_AutoDiscovery->isChecked() && mAutoDiscoveryNeeded) {
mAutoDiscoveryJob = new EwsAutodiscoveryJob(mUi->kcfg_Email->text(),
fullUsername(), mUi->passwordEdit->password(),
mUi->userAgentGroupBox->isEnabled() ? mUi->userAgentEdit->text() : QString(),
mUi->kcfg_EnableNTLMv2->isChecked(), this);
connect(mAutoDiscoveryJob, &EwsAutodiscoveryJob::result, this, &ConfigDialog::autoDiscoveryFinished);
mProgressDialog = new ProgressDialog(this, ProgressDialog::AutoDiscovery);
connect(mProgressDialog, &QDialog::rejected, this, &ConfigDialog::autoDiscoveryCancelled);
connect(mAutoDiscoveryJob, &EwsAutodiscoveryJob::result, this, &EwsConfigDialog::autoDiscoveryFinished);
mProgressDialog = new EwsProgressDialog(this, EwsProgressDialog::AutoDiscovery);
connect(mProgressDialog, &QDialog::rejected, this, &EwsConfigDialog::autoDiscoveryCancelled);
mAutoDiscoveryJob->start();
if (!mProgressDialog->exec()) {
if (KMessageBox::questionYesNo(this,
......@@ -306,9 +306,9 @@ void ConfigDialog::dialogAccepted()
mTryConnectJob = new EwsGetFolderRequest(cli, this);
mTryConnectJob->setFolderShape(EwsFolderShape(EwsShapeIdOnly));
mTryConnectJob->setFolderIds(EwsId::List() << EwsId(EwsDIdInbox));
connect(mTryConnectJob, &EwsGetFolderRequest::result, this, &ConfigDialog::tryConnectFinished);
mProgressDialog = new ProgressDialog(this, ProgressDialog::TryConnect);
connect(mProgressDialog, &QDialog::rejected, this, &ConfigDialog::tryConnectCancelled);
connect(mTryConnectJob, &EwsGetFolderRequest::result, this, &EwsConfigDialog::tryConnectFinished);
mProgressDialog = new EwsProgressDialog(this, EwsProgressDialog::TryConnect);
connect(mProgressDialog, &QDialog::rejected, this, &EwsConfigDialog::tryConnectCancelled);
mTryConnectJob->start();
if (!mProgressDialog->exec()) {
if (KMessageBox::questionYesNo(this,
......@@ -329,7 +329,7 @@ void ConfigDialog::dialogAccepted()
}
}
void ConfigDialog::enableTryConnect()
void EwsConfigDialog::enableTryConnect()
{
mTryConnectNeeded = true;
bool baseUrlEmpty = mUi->kcfg_BaseUrl->text().isEmpty();
......@@ -344,7 +344,7 @@ void ConfigDialog::enableTryConnect()
mUi->tryConnectButton->setEnabled(!baseUrlEmpty);
}
void ConfigDialog::tryConnect()
void EwsConfigDialog::tryConnect()
{
EwsClient cli;
cli.setUrl(mUi->kcfg_BaseUrl->text());
......@@ -356,8 +356,8 @@ void ConfigDialog::tryConnect()
mTryConnectJob = new EwsGetFolderRequest(cli, this);
mTryConnectJob->setFolderShape(EwsFolderShape(EwsShapeIdOnly));
mTryConnectJob->setFolderIds(EwsId::List() << EwsId(EwsDIdInbox));
mProgressDialog = new ProgressDialog(this, ProgressDialog::TryConnect);
connect(mProgressDialog, &QDialog::rejected, this, &ConfigDialog::tryConnectCancelled);
mProgressDialog = new EwsProgressDialog(this, EwsProgressDialog::TryConnect);
connect(mProgressDialog, &QDialog::rejected, this, &EwsConfigDialog::tryConnectCancelled);
mProgressDialog->show();
if (!mTryConnectJob->exec()) {
mUi->serverStatusText->setText(i18nc("Exchange server status", "Failed"));
......@@ -370,7 +370,7 @@ void ConfigDialog::tryConnect()
mProgressDialog->hide();
}
void ConfigDialog::userAgentChanged(int)
void EwsConfigDialog::userAgentChanged(int)
{
QString data = mUi->userAgentCombo->currentData().toString();
mUi->userAgentEdit->setEnabled(data.isEmpty());
......
......@@ -17,8 +17,8 @@
Boston, MA 02110-1301, USA.
*/
#ifndef CONFIGDIALOG_H
#define CONFIGDIALOG_H
#ifndef EWSCONFIGDIALOG_H
#define EWSCONFIGDIALOG_H
#include <QDialog>
......@@ -34,15 +34,15 @@ class SetupServerView;
class KJob;
class EwsAutodiscoveryJob;
class EwsGetFolderRequest;
class ProgressDialog;
class EwsProgressDialog;
class EwsSubscriptionWidget;
class ConfigDialog : public QDialog
class EwsConfigDialog : public QDialog
{
Q_OBJECT
public:
explicit ConfigDialog(EwsResource *parentResource, EwsClient &client, WId windowId);
~ConfigDialog() override;
explicit EwsConfigDialog(EwsResource *parentResource, EwsClient &client, WId windowId);
~EwsConfigDialog() override;
private:
void save();
void autoDiscoveryFinished(KJob *job);
......@@ -67,7 +67,7 @@ private:
EwsGetFolderRequest *mTryConnectJob = nullptr;
bool mAutoDiscoveryNeeded = false;
bool mTryConnectNeeded = false;
ProgressDialog *mProgressDialog = nullptr;
EwsProgressDialog *mProgressDialog = nullptr;
EwsSubscriptionWidget *mSubWidget = nullptr;
};
......
......@@ -17,7 +17,7 @@
Boston, MA 02110-1301, USA.
*/
#include "mtaconfigdialog.h"
#include "ewsmtaconfigdialog.h"
#include <QAbstractItemView>
#include <QDialogButtonBox>
......@@ -31,10 +31,10 @@
#include <AkonadiWidgets/AgentInstanceWidget>
#include "ewsmtaresource.h"
#include "mtasettings.h"
#include "ewsmtasettings.h"
#include "ui_mtaconfigdialog.h"
MtaConfigDialog::MtaConfigDialog(EwsMtaResource *parentResource, WId wId)
EwsMtaConfigDialog::EwsMtaConfigDialog(EwsMtaResource *parentResource, WId wId)
: QDialog(), mParentResource(parentResource)
{
if (wId) {
......@@ -48,8 +48,8 @@ MtaConfigDialog::MtaConfigDialog(EwsMtaResource *parentResource, WId wId)
QPushButton *okButton = mButtonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(mButtonBox, &QDialogButtonBox::accepted, this, &MtaConfigDialog::accept);
connect(mButtonBox, &QDialogButtonBox::rejected, this, &MtaConfigDialog::reject);
connect(mButtonBox, &QDialogButtonBox::accepted, this, &EwsMtaConfigDialog::accept);
connect(mButtonBox, &QDialogButtonBox::rejected, this, &EwsMtaConfigDialog::reject);
mainLayout->addWidget(mButtonBox);
setWindowTitle(i18n("Microsoft Exchange Mail Transport Configuration"));
......@@ -65,27 +65,27 @@ MtaConfigDialog::MtaConfigDialog(EwsMtaResource *parentResource, WId wId)
for (int i = 0; i < model->rowCount(); i++) {
QModelIndex index = model->index(i, 0);
QVariant v = model->data(index, Akonadi::AgentInstanceModel::InstanceIdentifierRole);
if (v.toString() == MtaSettings::ewsResource()) {
if (v.toString() == EwsMtaSettings::ewsResource()) {
mUi->resourceWidget->view()->setCurrentIndex(index);
}
}
connect(okButton, &QPushButton::clicked, this, &MtaConfigDialog::save);
connect(okButton, &QPushButton::clicked, this, &EwsMtaConfigDialog::save);
}
MtaConfigDialog::~MtaConfigDialog()
EwsMtaConfigDialog::~EwsMtaConfigDialog()
{
delete mUi;
}
void MtaConfigDialog::save()
void EwsMtaConfigDialog::save()
{
MtaSettings::setEwsResource(mUi->resourceWidget->selectedAgentInstances().first().identifier());
EwsMtaSettings::setEwsResource(mUi->resourceWidget->selectedAgentInstances().first().identifier());
mParentResource->setName(mUi->accountName->text());
MtaSettings::self()->save();
EwsMtaSettings::self()->save();
}
void MtaConfigDialog::dialogAccepted()
void EwsMtaConfigDialog::dialogAccepted()
{
}
......@@ -17,8 +17,8 @@
Boston, MA 02110-1301, USA.
*/
#ifndef MTACONFIGDIALOG_H
#define MTACONFIGDIALOG_H
#ifndef EWSMTACONFIGDIALOG_H
#define EWSMTACONFIGDIALOG_H
#include <QDialog>
......@@ -32,12 +32,12 @@ class SetupServerView;
}
class EwsMtaResource;
class MtaConfigDialog : public QDialog
class EwsMtaConfigDialog : public QDialog
{
Q_OBJECT
public:
explicit MtaConfigDialog(EwsMtaResource *parentResource, WId windowId);
~MtaConfigDialog() override;
explicit EwsMtaConfigDialog(EwsMtaResource *parentResource, WId windowId);
~EwsMtaConfigDialog() override;
private Q_SLOTS:
void save();
void dialogAccepted();
......
......@@ -24,9 +24,9 @@
#include <KMime/Message>
#include <KLocalizedString>
#include "ewsresource_debug.h"
#include "mtaconfigdialog.h"
#include "mtasettings.h"
#include "resourceinterface.h"
#include "ewsmtaconfigdialog.h"
#include "ewsmtasettings.h"
#include "ewsresourceinterface.h"
using namespace Akonadi;
......@@ -45,7 +45,7 @@ bool EwsMtaResource::connectEws()
return true;
}
mEwsResource = new OrgKdeAkonadiEwsResourceInterface(
QStringLiteral("org.freedesktop.Akonadi.Resource.") + MtaSettings::ewsResource(),
QStringLiteral("org.freedesktop.Akonadi.Resource.") + EwsMtaSettings::ewsResource(),
QStringLiteral("/"), QDBusConnection::sessionBus(), this);
if (!mEwsResource->isValid()) {
delete mEwsResource;
......@@ -59,9 +59,9 @@ bool EwsMtaResource::connectEws()
void EwsMtaResource::configure(WId windowId)
{
QPointer<MtaConfigDialog> dlg = new MtaConfigDialog(this, windowId);
QPointer<EwsMtaConfigDialog> dlg = new EwsMtaConfigDialog(this, windowId);
if (dlg->exec()) {
MtaSettings::self()->save();
EwsMtaSettings::self()->save();
}
delete dlg;
}
......
File=ewsmtaresource.kcfg
ClassName=MtaSettings
ClassName=EwsMtaSettings
Mutators=true
ItemAccessors=true
SetUserTexts=true
......
......@@ -17,7 +17,7 @@
Boston, MA 02110-1301, USA.
*/
#include "progressdialog.h"
#include "ewsprogressdialog.h"
#include <KLocalizedString>
......@@ -28,7 +28,7 @@
#include <QVBoxLayout>
ProgressDialog::ProgressDialog(QWidget *parent, Type type)
EwsProgressDialog::EwsProgressDialog(QWidget *parent, Type type)
: QDialog(parent)
{
setModal(true);
......@@ -72,6 +72,6 @@ ProgressDialog::ProgressDialog(QWidget *parent, Type type)
connect(cancelButton, &QPushButton::clicked, this, &QDialog::reject);
}
ProgressDialog::~ProgressDialog()
EwsProgressDialog::~EwsProgressDialog()
{
}
......@@ -17,13 +17,13 @@
Boston, MA 02110-1301, USA.
*/
#ifndef PROGRESSDIALOG_H
#define PROGRESSDIALOG_H
#ifndef EWSPROGRESSDIALOG_H
#define EWSPROGRESSDIALOG_H
#include <QDialog>
class ProgressDialog : public QDialog
class EwsProgressDialog : public QDialog
{
Q_OBJECT
public:
......@@ -32,8 +32,8 @@ public:
TryConnect
};
ProgressDialog(QWidget *parent, Type type);
~ProgressDialog() override;
EwsProgressDialog(QWidget *parent, Type type);
~EwsProgressDialog() override;
};
#endif
......@@ -50,8 +50,8 @@
#include "ewsitemhandler.h"
#include "ewsmodifyitemjob.h"
#include "ewscreateitemjob.h"
#include "configdialog.h"
#include "settings.h"
#include "ewsconfigdialog.h"
#include "ewssettings.h"
#ifdef HAVE_SEPARATE_MTA_RESOURCE
#include "ewscreateitemrequest.h"
#endif
......@@ -61,9 +61,9 @@
#include "tags/ewsglobaltagsreadjob.h"
#include "ewsresource_debug.h"
#include "resourceadaptor.h"
#include "settingsadaptor.h"
#include "walletadaptor.h"
#include "ewsresourceadaptor.h"
#include "ewssettingsadaptor.h"
#include "ewswalletadaptor.h"
using namespace Akonadi;
......@@ -97,7 +97,7 @@ static Q_CONSTEXPR int ReconnectTimeout = 300;
EwsResource::EwsResource(const QString &id)
: Akonadi::ResourceBase(id), mTagsRetrieved(false), mReconnectTimeout(InitialReconnectTimeout),
mSettings(new Settings(winIdForDialogs()))
mSettings(new EwsSettings(winIdForDialogs()))
{
//setName(i18n("Microsoft Exchange"));
mEwsClient.setUrl(mSettings->baseUrl());
......@@ -163,9 +163,9 @@ EwsResource::~EwsResource()
void EwsResource::delayedInit()
{
new ResourceAdaptor(this);
new SettingsAdaptor(mSettings.data());
new WalletAdaptor(mSettings.data());
new EwsResourceAdaptor(this);
new EwsSettingsAdaptor(mSettings.data());
new EwsWalletAdaptor(mSettings.data());
QDBusConnection::sessionBus().registerObject(QStringLiteral("/Settings"),
mSettings.data(), QDBusConnection::ExportAdaptors);
}
......@@ -473,7 +473,7 @@ void EwsResource::reloadConfig()
void EwsResource::configure(WId windowId)
{
QPointer<ConfigDialog> dlg = new ConfigDialog(this, mEwsClient, windowId);
QPointer<EwsConfigDialog> dlg = new EwsConfigDialog(this, mEwsClient, windowId);
if (dlg->exec()) {
reloadConfig();
Q_EMIT configurationDialogAccepted();
......
......@@ -35,7 +35,7 @@
class FetchItemState;
class EwsSubscriptionManager;
class EwsTagStore;
class Settings;
class EwsSettings;
class EwsResource : public Akonadi::ResourceBase, public Akonadi::AgentBase::ObserverV4,
public Akonadi::TransportResourceBase
......@@ -79,7 +79,7 @@ public:
return mRootCollection;
}
Settings *settings()
EwsSettings *settings()
{
return mSettings.data();
}
......@@ -156,7 +156,7 @@ private:
bool mTagsRetrieved;
int mReconnectTimeout;
EwsTagStore *mTagStore = nullptr;
QScopedPointer<Settings> mSettings;
QScopedPointer<EwsSettings> mSettings;
};
#endif