summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Nowicki <[email protected]>2017-10-14 16:17:17 +0200
committerKrzysztof Nowicki <[email protected]>2017-10-14 16:20:20 +0200
commitbcc0e5e8787e98644a16de649636e9cfdcf56010 (patch)
tree9377e0eedf95904e896d550f0f21145e72df91c0
parent708fd641b81145253c64b44eb8cbbcf39bbc7e16 (diff)
EWS: Rename files to make them unique across the tree
-rw-r--r--resources/ews/CMakeLists.txt32
-rw-r--r--resources/ews/ewsconfigdialog.cpp (renamed from resources/ews/configdialog.cpp)84
-rw-r--r--resources/ews/ewsconfigdialog.h (renamed from resources/ews/configdialog.h)14
-rw-r--r--resources/ews/ewsconfigdialog.ui (renamed from resources/ews/configdialog.ui)0
-rw-r--r--resources/ews/ewsmtaconfigdialog.cpp (renamed from resources/ews/mtaconfigdialog.cpp)24
-rw-r--r--resources/ews/ewsmtaconfigdialog.h (renamed from resources/ews/mtaconfigdialog.h)10
-rw-r--r--resources/ews/ewsmtaconfigdialog.ui (renamed from resources/ews/mtaconfigdialog.ui)0
-rw-r--r--resources/ews/ewsmtaresource.cpp12
-rw-r--r--resources/ews/ewsmtasettings.kcfgc (renamed from resources/ews/mtasettings.kcfgc)2
-rw-r--r--resources/ews/ewsprogressdialog.cpp (renamed from resources/ews/progressdialog.cpp)6
-rw-r--r--resources/ews/ewsprogressdialog.h (renamed from resources/ews/progressdialog.h)10
-rw-r--r--resources/ews/ewsresource.cpp20
-rw-r--r--resources/ews/ewsresource.h6
-rw-r--r--resources/ews/ewssettings.cpp (renamed from resources/ews/settings.cpp)15
-rw-r--r--resources/ews/ewssettings.h (renamed from resources/ews/settings.h)12
-rw-r--r--resources/ews/ewssettingsbase.kcfgc (renamed from resources/ews/settingsbase.kcfgc)2
-rw-r--r--resources/ews/ewssubscribedfoldersjob.cpp4
-rw-r--r--resources/ews/ewssubscribedfoldersjob.h6
-rw-r--r--resources/ews/ewssubscriptionmanager.cpp4
-rw-r--r--resources/ews/ewssubscriptionmanager.h6
-rw-r--r--resources/ews/ewssubscriptionwidget.cpp10
-rw-r--r--resources/ews/ewssubscriptionwidget.h4
-rw-r--r--resources/ews/test/CMakeLists.txt2
23 files changed, 142 insertions, 143 deletions
diff --git a/resources/ews/CMakeLists.txt b/resources/ews/CMakeLists.txt
index 4ab6397..74eedfc 100644
--- a/resources/ews/CMakeLists.txt
+++ b/resources/ews/CMakeLists.txt
@@ -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
diff --git a/resources/ews/configdialog.cpp b/resources/ews/ewsconfigdialog.cpp
index ce00f0e..04189ea 100644
--- a/resources/ews/configdialog.cpp
+++ b/resources/ews/ewsconfigdialog.cpp
@@ -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());
diff --git a/resources/ews/configdialog.h b/resources/ews/ewsconfigdialog.h
index 5df19bf..59d6403 100644
--- a/resources/ews/configdialog.h
+++ b/resources/ews/ewsconfigdialog.h
@@ -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;
};
diff --git a/resources/ews/configdialog.ui b/resources/ews/ewsconfigdialog.ui
index 426a24e..426a24e 100644
--- a/resources/ews/configdialog.ui
+++ b/resources/ews/ewsconfigdialog.ui
diff --git a/resources/ews/mtaconfigdialog.cpp b/resources/ews/ewsmtaconfigdialog.cpp
index 29949bd..95c8875 100644
--- a/resources/ews/mtaconfigdialog.cpp
+++ b/resources/ews/ewsmtaconfigdialog.cpp
@@ -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()
{
}
diff --git a/resources/ews/mtaconfigdialog.h b/resources/ews/ewsmtaconfigdialog.h
index 42ca1d8..5d787d0 100644
--- a/resources/ews/mtaconfigdialog.h
+++ b/resources/ews/ewsmtaconfigdialog.h
@@ -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();
diff --git a/resources/ews/mtaconfigdialog.ui b/resources/ews/ewsmtaconfigdialog.ui
index 6bf7f3b..6bf7f3b 100644
--- a/resources/ews/mtaconfigdialog.ui
+++ b/resources/ews/ewsmtaconfigdialog.ui
diff --git a/resources/ews/ewsmtaresource.cpp b/resources/ews/ewsmtaresource.cpp
index b908054..29cfcdd 100644
--- a/resources/ews/ewsmtaresource.cpp
+++ b/resources/ews/ewsmtaresource.cpp
@@ -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;
}
diff --git a/resources/ews/mtasettings.kcfgc b/resources/ews/ewsmtasettings.kcfgc
index 1f748a4..7c4fe56 100644
--- a/resources/ews/mtasettings.kcfgc
+++ b/resources/ews/ewsmtasettings.kcfgc
@@ -1,5 +1,5 @@
File=ewsmtaresource.kcfg
-ClassName=MtaSettings
+ClassName=EwsMtaSettings
Mutators=true
ItemAccessors=true
SetUserTexts=true
diff --git a/resources/ews/progressdialog.cpp b/resources/ews/ewsprogressdialog.cpp
index 69b176a..261c5db 100644
--- a/resources/ews/progressdialog.cpp
+++ b/resources/ews/ewsprogressdialog.cpp
@@ -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()
{
}
diff --git a/resources/ews/progressdialog.h b/resources/ews/ewsprogressdialog.h
index fad984a..51615ee 100644
--- a/resources/ews/progressdialog.h
+++ b/resources/ews/ewsprogressdialog.h
@@ -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
diff --git a/resources/ews/ewsresource.cpp b/resources/ews/ewsresource.cpp
index b03b072..a381702 100644
--- a/resources/ews/ewsresource.cpp
+++ b/resources/ews/ewsresource.cpp
@@ -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();
diff --git a/resources/ews/ewsresource.h b/resources/ews/ewsresource.h
index 38bfb97..04e0196 100644
--- a/resources/ews/ewsresource.h
+++ b/resources/ews/ewsresource.h
@@ -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
diff --git a/resources/ews/settings.cpp b/resources/ews/ewssettings.cpp
index 46e9732..216174c 100644
--- a/resources/ews/settings.cpp
+++ b/resources/ews/ewssettings.cpp
@@ -17,24 +17,23 @@
Boston, MA 02110-1301, USA.
*/
-#include "settings.h"
-
+#include <ewssettings.h>
#include <QPointer>
#include <KPasswordDialog>
#include <KWallet/KWallet>
#include <KLocalizedString>
-Settings::Settings(WId windowId)
- : SettingsBase(), mWindowId(windowId)
+EwsSettings::EwsSettings(WId windowId)
+ : EwsSettingsBase(), mWindowId(windowId)
{
}
-Settings::~Settings()
+EwsSettings::~EwsSettings()
{
}
-bool Settings::requestPassword(QString &password, bool ask)
+bool EwsSettings::requestPassword(QString &password, bool ask)
{
bool status = true;
@@ -79,7 +78,7 @@ bool Settings::requestPassword(QString &password, bool ask)
return true;
}
-void Settings::setPassword(const QString &password)
+void EwsSettings::setPassword(const QString &password)
{
mPassword = password;
QScopedPointer<KWallet::Wallet> wallet(KWallet::Wallet::openWallet(KWallet::Wallet::NetworkWallet(),
@@ -93,7 +92,7 @@ void Settings::setPassword(const QString &password)
}
}
-void Settings::setTestPassword(const QString &password)
+void EwsSettings::setTestPassword(const QString &password)
{
mPassword = password;
}
diff --git a/resources/ews/settings.h b/resources/ews/ewssettings.h
index 0906c0b..aae96a2 100644
--- a/resources/ews/settings.h
+++ b/resources/ews/ewssettings.h
@@ -17,18 +17,18 @@
Boston, MA 02110-1301, USA.
*/
-#ifndef SETTINGS_H
-#define SETTINGS_H
+#ifndef EWSSETTINGS_H
+#define EWSSETTINGS_H
-#include "settingsbase.h"
+#include "ewssettingsbase.h"
-class Settings : public SettingsBase
+class EwsSettings : public EwsSettingsBase
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.kde.Akonadi.Ews.Wallet")
public:
- explicit Settings(WId windowId);
- ~Settings() override;
+ explicit EwsSettings(WId windowId);
+ ~EwsSettings() override;
bool requestPassword(QString &password, bool ask);
public Q_SLOTS:
diff --git a/resources/ews/settingsbase.kcfgc b/resources/ews/ewssettingsbase.kcfgc
index 6691e4a..efd387f 100644
--- a/resources/ews/settingsbase.kcfgc
+++ b/resources/ews/ewssettingsbase.kcfgc
@@ -1,5 +1,5 @@
File=ewsresource.kcfg
-ClassName=SettingsBase
+ClassName=EwsSettingsBase
Mutators=true
ItemAccessors=true
SetUserTexts=true
diff --git a/resources/ews/ewssubscribedfoldersjob.cpp b/resources/ews/ewssubscribedfoldersjob.cpp
index cd5ece0..331093a 100644
--- a/resources/ews/ewssubscribedfoldersjob.cpp
+++ b/resources/ews/ewssubscribedfoldersjob.cpp
@@ -20,11 +20,11 @@
#include "ewssubscribedfoldersjob.h"
#include "ewsclient.h"
+#include "ewssettings.h"
#include "ewsgetfolderrequest.h"
-#include "settings.h"
#include "ewsresource_debug.h"
-EwsSubscribedFoldersJob::EwsSubscribedFoldersJob(EwsClient &client, Settings *settings, QObject *parent)
+EwsSubscribedFoldersJob::EwsSubscribedFoldersJob(EwsClient &client, EwsSettings *settings, QObject *parent)
: EwsJob(parent), mClient(client), mSettings(settings)
{
diff --git a/resources/ews/ewssubscribedfoldersjob.h b/resources/ews/ewssubscribedfoldersjob.h
index 8aea4a4..e4cc97b 100644
--- a/resources/ews/ewssubscribedfoldersjob.h
+++ b/resources/ews/ewssubscribedfoldersjob.h
@@ -24,13 +24,13 @@
#include "ewsid.h"
class EwsClient;
-class Settings;
+class EwsSettings;
class EwsSubscribedFoldersJob : public EwsJob
{
Q_OBJECT
public:
- EwsSubscribedFoldersJob(EwsClient &client, Settings *settings, QObject *parent);
+ EwsSubscribedFoldersJob(EwsClient &client, EwsSettings *settings, QObject *parent);
~EwsSubscribedFoldersJob();
void start() override;
@@ -46,7 +46,7 @@ private Q_SLOTS:
private:
EwsId::List mFolders;
EwsClient &mClient;
- Settings *mSettings = nullptr;
+ EwsSettings *mSettings = nullptr;
};
#endif
diff --git a/resources/ews/ewssubscriptionmanager.cpp b/resources/ews/ewssubscriptionmanager.cpp
index 158a02e..f9b4892 100644
--- a/resources/ews/ewssubscriptionmanager.cpp
+++ b/resources/ews/ewssubscriptionmanager.cpp
@@ -26,7 +26,7 @@
#include "ewssubscribedfoldersjob.h"
#include "ewssubscriberequest.h"
#include "ewsunsubscriberequest.h"
-#include "settings.h"
+#include "ewssettings.h"
#include <QPointer>
// TODO: Allow customization
@@ -37,7 +37,7 @@ static Q_CONSTEXPR uint streamingTimeout = 30; /* minutes */
static Q_CONSTEXPR uint streamingConnTimeout = 60; /* seconds */
EwsSubscriptionManager::EwsSubscriptionManager(EwsClient &client, const EwsId &rootId,
- Settings *settings, QObject *parent)
+ EwsSettings *settings, QObject *parent)
: QObject(parent), mEwsClient(client), mPollTimer(this), mMsgRootId(rootId), mFolderTreeChanged(false),
mEventReq(nullptr), mSettings(settings)
{
diff --git a/resources/ews/ewssubscriptionmanager.h b/resources/ews/ewssubscriptionmanager.h
index 1c7da23..5052b4c 100644
--- a/resources/ews/ewssubscriptionmanager.h
+++ b/resources/ews/ewssubscriptionmanager.h
@@ -29,7 +29,7 @@
class EwsClient;
class KJob;
class EwsEventRequestBase;
-class Settings;
+class EwsSettings;
/**
* @brief Mailbox update subscription manager class
@@ -69,7 +69,7 @@ class EwsSubscriptionManager : public QObject
{
Q_OBJECT
public:
- EwsSubscriptionManager(EwsClient &client, const EwsId &rootId, Settings *settings, QObject *parent);
+ EwsSubscriptionManager(EwsClient &client, const EwsId &rootId, EwsSettings *settings, QObject *parent);
~EwsSubscriptionManager() override;
void start();
void queueUpdate(EwsEventType type, const QString &id, const QString &changeKey);
@@ -108,7 +108,7 @@ private:
QMultiHash<QString, UpdateItem> mQueuedUpdates;
QTimer mStreamingTimer;
EwsEventRequestBase *mEventReq = nullptr;
- Settings *mSettings = nullptr;
+ EwsSettings *mSettings = nullptr;
};
#endif
diff --git a/resources/ews/ewssubscriptionwidget.cpp b/resources/ews/ewssubscriptionwidget.cpp
index 8b2bb86..35ddd3f 100644
--- a/resources/ews/ewssubscriptionwidget.cpp
+++ b/resources/ews/ewssubscriptionwidget.cpp
@@ -34,7 +34,7 @@
#include "ewsclient.h"
#include "ewsfindfolderrequest.h"
#include "ewssubscribedfoldersjob.h"
-#include "settings.h"
+#include "ewssettings.h"
class EwsSubscriptionFilterModel : public KRecursiveFilterProxyModel
{
@@ -55,7 +55,7 @@ class EwsSubscriptionWidgetPrivate : public QObject
{
Q_OBJECT
public:
- EwsSubscriptionWidgetPrivate(EwsClient &client, Settings *settings, QObject *parent);
+ EwsSubscriptionWidgetPrivate(EwsClient &client, EwsSettings *settings, QObject *parent);
~EwsSubscriptionWidgetPrivate();
enum TreeModelRoles {
@@ -88,7 +88,7 @@ public:
EwsId::List mOrigSubscribedIds;
bool mSubscribedIdsRetrieved = true;
EwsSubscriptionFilterModel *mFilterModel = nullptr;
- Settings *mSettings = nullptr;
+ EwsSettings *mSettings = nullptr;
EwsSubscriptionWidget *q_ptr = nullptr;
Q_DECLARE_PUBLIC(EwsSubscriptionWidget)
@@ -143,7 +143,7 @@ void EwsSubscriptionFilterModel::setFilterSelected(bool enabled)
invalidateFilter();
}
-EwsSubscriptionWidgetPrivate::EwsSubscriptionWidgetPrivate(EwsClient &client, Settings *settings,
+EwsSubscriptionWidgetPrivate::EwsSubscriptionWidgetPrivate(EwsClient &client, EwsSettings *settings,
QObject *parent)
: QObject(parent), mClient(client), mSubscribedIdsRetrieved(false), mSettings(settings)
{
@@ -282,7 +282,7 @@ void EwsSubscriptionWidgetPrivate::resetSelection(bool)
populateFolderTree();
}
-EwsSubscriptionWidget::EwsSubscriptionWidget(EwsClient &client, Settings *settings, QWidget *parent)
+EwsSubscriptionWidget::EwsSubscriptionWidget(EwsClient &client, EwsSettings *settings, QWidget *parent)
: QWidget(parent), d_ptr(new EwsSubscriptionWidgetPrivate(client, settings, this))
{
Q_D(EwsSubscriptionWidget);
diff --git a/resources/ews/ewssubscriptionwidget.h b/resources/ews/ewssubscriptionwidget.h
index 2c97ddc..cdd954d 100644
--- a/resources/ews/ewssubscriptionwidget.h
+++ b/resources/ews/ewssubscriptionwidget.h
@@ -27,13 +27,13 @@
class EwsSubscriptionWidgetPrivate;
class EwsClient;
-class Settings;
+class EwsSettings;
class EwsSubscriptionWidget : public QWidget
{
Q_OBJECT
public:
- EwsSubscriptionWidget(EwsClient &client, Settings *settings, QWidget *parent);
+ EwsSubscriptionWidget(EwsClient &client, EwsSettings *settings, QWidget *parent);
~EwsSubscriptionWidget();
QStringList subscribedList() const;
diff --git a/resources/ews/test/CMakeLists.txt b/resources/ews/test/CMakeLists.txt
index 22caaf8..2f00bf3 100644
--- a/resources/ews/test/CMakeLists.txt
+++ b/resources/ews/test/CMakeLists.txt
@@ -24,7 +24,7 @@ set(isolatestestcommon_SRCS isolatedtestbase.cpp statemonitor.cpp)
kcfg_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/../ewsresource.kcfg org.kde.Akonadi.Ews.Settings)
set(ewssettingsinterface_xml ${CMAKE_CURRENT_BINARY_DIR}/org.kde.Akonadi.Ews.Settings.xml)
-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 )
set(ewswalletinterface_xml ${CMAKE_CURRENT_BINARY_DIR}/org.kde.Akonadi.Ews.Wallet.xml)
qt5_add_dbus_interface(isolatestestcommon_SRCS ${ewssettingsinterface_xml} ewssettings)