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

Coding style

parent 548f610e
......@@ -24,12 +24,10 @@
ServerSieveSettingsTest::ServerSieveSettingsTest(QObject *parent)
: QObject(parent)
{
}
ServerSieveSettingsTest::~ServerSieveSettingsTest()
{
}
void ServerSieveSettingsTest::shouldHaveDefaultValue()
......@@ -101,7 +99,6 @@ void ServerSieveSettingsTest::shouldEmitSignalWithValueTrue()
widget.setServerName(QStringLiteral(" "));
QCOMPARE(spy.count(), 4);
QCOMPARE(spy.at(3).at(0).toBool(), false);
}
QTEST_MAIN(ServerSieveSettingsTest)
......@@ -26,19 +26,17 @@
SieveEditorConfigureServerPageTest::SieveEditorConfigureServerPageTest(QObject *parent)
: QObject(parent)
{
}
SieveEditorConfigureServerPageTest::~SieveEditorConfigureServerPageTest()
{
}
void SieveEditorConfigureServerPageTest::shouldHaveDefaultValue()
{
SieveEditorConfigureServerPage w;
QPushButton *button = w.findChild<QPushButton *>(QStringLiteral("configure_button"));
QVERIFY(button);
QVERIFY(button);
QPushButton *importSieveSettings = w.findChild<QPushButton *>(QStringLiteral("import_sieve_settings_button"));
QVERIFY(importSieveSettings);
......
......@@ -24,12 +24,10 @@
SieveEditorUtilTest::SieveEditorUtilTest(QObject *parent)
: QObject(parent)
{
}
SieveEditorUtilTest::~SieveEditorUtilTest()
{
}
void SieveEditorUtilTest::shouldHaveDefaultValue()
......@@ -91,4 +89,3 @@ void SieveEditorUtilTest::shouldBeEqual()
}
QTEST_APPLESS_MAIN(SieveEditorUtilTest)
......@@ -28,12 +28,10 @@
ImportImapSettingFinishPageTest::ImportImapSettingFinishPageTest(QObject *parent)
: QObject(parent)
{
}
ImportImapSettingFinishPageTest::~ImportImapSettingFinishPageTest()
{
}
void ImportImapSettingFinishPageTest::shouldHaveDefaultValue()
......
......@@ -26,12 +26,10 @@
ImportImapSettingNoFoundPageTest::ImportImapSettingNoFoundPageTest(QObject *parent)
: QObject(parent)
{
}
ImportImapSettingNoFoundPageTest::~ImportImapSettingNoFoundPageTest()
{
}
void ImportImapSettingNoFoundPageTest::shouldHaveDefaultValue()
......
......@@ -33,7 +33,6 @@ ImportImapSettingProgressPageTest::ImportImapSettingProgressPageTest(QObject *pa
ImportImapSettingProgressPageTest::~ImportImapSettingProgressPageTest()
{
}
void ImportImapSettingProgressPageTest::shouldHaveDefaultValue()
......
......@@ -35,7 +35,6 @@ ImportImapSettingsAkonadiCheckJobTest::ImportImapSettingsAkonadiCheckJobTest(QOb
ImportImapSettingsAkonadiCheckJobTest::~ImportImapSettingsAkonadiCheckJobTest()
{
}
void ImportImapSettingsAkonadiCheckJobTest::initTestCase()
......
......@@ -33,7 +33,6 @@ ImportImapSettingSearchPageTest::ImportImapSettingSearchPageTest(QObject *parent
ImportImapSettingSearchPageTest::~ImportImapSettingSearchPageTest()
{
}
void ImportImapSettingSearchPageTest::shouldHaveDefaultValue()
......@@ -55,7 +54,9 @@ void ImportImapSettingSearchPageTest::shouldHaveDefaultValue()
void ImportImapSettingSearchPageTest::shouldAddCheckPrograms()
{
ImportImapSettingSearchPage w;
const QStringList lst { QStringLiteral("foo"), QStringLiteral("bla"), QStringLiteral("do") };
const QStringList lst {
QStringLiteral("foo"), QStringLiteral("bla"), QStringLiteral("do")
};
w.setProgramList(lst);
QListWidget *mFoundProgramList = w.findChild<QListWidget *>(QStringLiteral("foundprogramlist"));
......
......@@ -21,7 +21,6 @@
ImportImapSettingsPasswordTest::ImportImapSettingsPasswordTest()
{
}
void ImportImapSettingsPasswordTest::importPasswords(SieveEditorUtil::SieveServerConfig &config, const QString &filename, bool reuseImapSettings)
......
......@@ -36,7 +36,6 @@ ImportImapSettingsThunderbirdCheckJobTest::ImportImapSettingsThunderbirdCheckJob
ImportImapSettingsThunderbirdCheckJobTest::~ImportImapSettingsThunderbirdCheckJobTest()
{
}
void ImportImapSettingsThunderbirdCheckJobTest::shouldHaveDefaultValue()
......
......@@ -21,11 +21,10 @@
#include "abstractimapsettingspassword.h"
AbstractImapSettingsCheckJob::AbstractImapSettingsCheckJob(QObject *parent)
: QObject(parent),
mPasswordImporter(nullptr),
mSettingsWereImported(false)
: QObject(parent)
, mPasswordImporter(nullptr)
, mSettingsWereImported(false)
{
}
AbstractImapSettingsCheckJob::~AbstractImapSettingsCheckJob()
......
......@@ -21,12 +21,10 @@
AbstractImapSettingsPassword::AbstractImapSettingsPassword()
{
}
AbstractImapSettingsPassword::~AbstractImapSettingsPassword()
{
}
void AbstractImapSettingsPassword::importPasswords(SieveEditorUtil::SieveServerConfig &config, const QString &filename, bool reuseImapSettings)
......
......@@ -35,13 +35,12 @@ ImportImapSettingsAkonadiCheckJob::ImportImapSettingsAkonadiCheckJob(QObject *pa
ImportImapSettingsAkonadiCheckJob::~ImportImapSettingsAkonadiCheckJob()
{
}
bool ImportImapSettingsAkonadiCheckJob::resourceCanHaveSieveSupport(const QString &filename) const
{
return filename.startsWith(QStringLiteral("akonadi_kolab_resource")) ||
filename.startsWith(QStringLiteral("akonadi_imap_resource"));
return filename.startsWith(QStringLiteral("akonadi_kolab_resource"))
|| filename.startsWith(QStringLiteral("akonadi_imap_resource"));
}
void ImportImapSettingsAkonadiCheckJob::start()
......@@ -111,7 +110,9 @@ bool ImportImapSettingsAkonadiCheckJob::importSettings(const QString &directory,
if (reuseImapSettings) {
config.sieveSettings.serverName = imapServerName;
config.sieveSettings.userName = userName;
config.sieveSettings.authenticationType = static_cast<MailTransport::Transport::EnumAuthenticationType::type>(sieveGroup.readEntry(QStringLiteral("Authentication"), static_cast<int>(MailTransport::Transport::EnumAuthenticationType::PLAIN)));
config.sieveSettings.authenticationType
= static_cast<MailTransport::Transport::EnumAuthenticationType::type>(sieveGroup.readEntry(QStringLiteral("Authentication"),
static_cast<int>(MailTransport::Transport::EnumAuthenticationType::PLAIN)));
} else {
const QString sieveCustomUserName = sieveGroup.readEntry(QStringLiteral("SieveCustomUsername"));
config.sieveSettings.userName = sieveCustomUserName;
......
......@@ -24,12 +24,10 @@
ImportImapSettingsAkonadiPassword::ImportImapSettingsAkonadiPassword()
: AbstractImapSettingsPassword()
{
}
ImportImapSettingsAkonadiPassword::~ImportImapSettingsAkonadiPassword()
{
}
void ImportImapSettingsAkonadiPassword::importPasswords(SieveEditorUtil::SieveServerConfig &config, const QString &filename, bool reuseImapSettings)
......@@ -56,5 +54,4 @@ void ImportImapSettingsAkonadiPassword::importPasswords(SieveEditorUtil::SieveSe
}
}
}
}
......@@ -31,12 +31,10 @@ LIBSIEVEEDITOR_EXPORT QString sieveeditor_thunderbird_default_toplevel_path = QD
ImportImapSettingsThunderbirdCheckJob::ImportImapSettingsThunderbirdCheckJob(QObject *parent)
: AbstractImapSettingsCheckJob(parent)
{
}
ImportImapSettingsThunderbirdCheckJob::~ImportImapSettingsThunderbirdCheckJob()
{
}
//Copy from mailimporter
......@@ -107,19 +105,18 @@ bool ImportImapSettingsThunderbirdCheckJob::importSettings(const QString &direct
while (!stream.atEnd()) {
const QString line = stream.readLine();
if (line.startsWith(QStringLiteral("user_pref"))) {
if (line.contains(QStringLiteral("mail.server.")) ||
line.contains(QStringLiteral("mail.account.")) ||
line.contains(QStringLiteral("mail.accountmanager.")) ||
line.contains(QStringLiteral("extensions.sieve.account."))) {
if (line.contains(QStringLiteral("mail.server."))
|| line.contains(QStringLiteral("mail.account."))
|| line.contains(QStringLiteral("mail.accountmanager."))
|| line.contains(QStringLiteral("extensions.sieve.account."))) {
insertIntoMap(line);
}
} else {
if (!line.startsWith(QLatin1Char('#')) &&
line.isEmpty() &&
line.startsWith(QStringLiteral("/*")) &&
line.startsWith(QStringLiteral(" */")) &&
line.startsWith(QStringLiteral(" *"))) {
if (!line.startsWith(QLatin1Char('#'))
&& line.isEmpty()
&& line.startsWith(QStringLiteral("/*"))
&& line.startsWith(QStringLiteral(" */"))
&& line.startsWith(QStringLiteral(" *"))) {
qCDebug(SIEVEEDITOR_LOG) << " unstored line :" << line;
}
}
......@@ -200,7 +197,6 @@ bool ImportImapSettingsThunderbirdCheckJob::importSettings(const QString &direct
} else {
//qCDebug(SIEVEEDITOR_LOG) << "Account " << accountName << " is not a imap account. Skip it.";
}
}
return atLeastAnAccountFound;
}
......
......@@ -43,11 +43,9 @@ ImportImapSettingFinishPage::ImportImapSettingFinishPage(QWidget *parent)
ImportImapSettingFinishPage::~ImportImapSettingFinishPage()
{
}
void ImportImapSettingFinishPage::addSummary(const QString &name)
{
mTextEdit->append(name);
}
......@@ -41,5 +41,4 @@ ImportImapSettingNoFoundPage::ImportImapSettingNoFoundPage(QWidget *parent)
ImportImapSettingNoFoundPage::~ImportImapSettingNoFoundPage()
{
}
......@@ -25,8 +25,8 @@
#include <QTextEdit>
ImportImapSettingProgressPage::ImportImapSettingProgressPage(QWidget *parent)
: QWidget(parent),
mSettingsFound(false)
: QWidget(parent)
, mSettingsFound(false)
{
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
......@@ -39,7 +39,6 @@ ImportImapSettingProgressPage::ImportImapSettingProgressPage(QWidget *parent)
ImportImapSettingProgressPage::~ImportImapSettingProgressPage()
{
}
void ImportImapSettingProgressPage::addProgressInfo(const QString &str)
......
......@@ -41,7 +41,6 @@ ImportImapSettingSearchPage::ImportImapSettingSearchPage(QWidget *parent)
ImportImapSettingSearchPage::~ImportImapSettingSearchPage()
{
}
void ImportImapSettingSearchPage::setProgramList(const QStringList &lst)
......
......@@ -28,4 +28,3 @@ int main(int argc, char *argv[])
ImportImapSettingWizard wizard;
return wizard.exec();
}
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