From b03dc485c875b7943dec8534267a5b7df09e73d4 Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Tue, 31 Oct 2017 22:33:00 +0100 Subject: [PATCH] GIT_SILENT: coding style --- autotests/dummykernel.cpp | 1 - autotests/dummykernel.h | 6 ++---- autotests/foldertreewidgettest.cpp | 16 ++++++++++++---- .../autotests/filterimporterpathcachetest.cpp | 4 ---- src/filter/filteractions/filteractionwidget.cpp | 8 ++++++-- src/filter/filterimporterpathcache.cpp | 2 -- src/filter/filterimporterpathcache.h | 5 ++--- src/filter/mailfilter.cpp | 5 +++-- src/search/searchpatternedit.cpp | 4 ++-- src/snippets/snippetsmanager.cpp | 4 +++- 10 files changed, 30 insertions(+), 25 deletions(-) diff --git a/autotests/dummykernel.cpp b/autotests/dummykernel.cpp index 9652368..6393e2f 100644 --- a/autotests/dummykernel.cpp +++ b/autotests/dummykernel.cpp @@ -109,4 +109,3 @@ void DummyKernel::setLastSelectedFolder(Akonadi::Collection::Id col) { Q_UNUSED(col); } - diff --git a/autotests/dummykernel.h b/autotests/dummykernel.h index 0b9600d..9e78d4e 100644 --- a/autotests/dummykernel.h +++ b/autotests/dummykernel.h @@ -3,14 +3,12 @@ #include -namespace Akonadi -{ +namespace Akonadi { class EntityTreeModel; class EntityMimeTypeFilterModel; } -namespace MailCommon -{ +namespace MailCommon { class FolderCollectionMonitor; } diff --git a/autotests/foldertreewidgettest.cpp b/autotests/foldertreewidgettest.cpp index 4bc1a53..357cdf5 100644 --- a/autotests/foldertreewidgettest.cpp +++ b/autotests/foldertreewidgettest.cpp @@ -68,7 +68,9 @@ private Q_SLOTS: CommonKernel->registerSettingsIf(kernel); mFolderTreeWidget = new MailCommon::FolderTreeWidget(nullptr); - const QStringList resourceOrder{"akonadi_knut_resource_2", "akonadi_knut_resource_0"}; // _1 isn't specified so it goes at the end + const QStringList resourceOrder{ + "akonadi_knut_resource_2", "akonadi_knut_resource_0" + }; // _1 isn't specified so it goes at the end mFolderTreeWidget->entityOrderProxy()->setTopLevelOrder(resourceOrder); mCollectionModel = KernelIf->collectionModel(); @@ -77,7 +79,9 @@ private Q_SLOTS: // One knut resource is already defined in the unittestenv, so that it's below "Search" in the ETM. QTRY_COMPARE(mCollectionModel->rowCount(), 2); QCOMPARE(mTopModel->rowCount(), 1); // Search doesn't appear yet - mFolderNames = QStringList{"res1"}; + mFolderNames = QStringList{ + "res1" + }; QCOMPARE(collectNames(mTopModel), mFolderNames); } @@ -139,11 +143,15 @@ private Q_SLOTS: { // Test creating more knut resources. // This tests that ETM and proxies on top update correctly, and it tests toplevel collection order. - const QVector numFolders{ 1, 5, 2 }; + const QVector numFolders{ + 1, 5, 2 + }; QVector topLevelCollections; const AgentType agentType = AgentManager::self()->type(QStringLiteral("akonadi_knut_resource")); QVERIFY(agentType.isValid()); - mFolderNames = QStringList{"res3", "res1", "res2"}; // according to resourceOrder above (the folder names are defined in testdata-res*.xml) + mFolderNames = QStringList{ + "res3", "res1", "res2" + }; // according to resourceOrder above (the folder names are defined in testdata-res*.xml) // Create resources const int numResources = numFolders.count(); diff --git a/src/filter/autotests/filterimporterpathcachetest.cpp b/src/filter/autotests/filterimporterpathcachetest.cpp index 7a451b4..4e40ae9 100644 --- a/src/filter/autotests/filterimporterpathcachetest.cpp +++ b/src/filter/autotests/filterimporterpathcachetest.cpp @@ -25,12 +25,10 @@ QTEST_MAIN(FilterImporterPathCacheTest) FilterImporterPathCacheTest::FilterImporterPathCacheTest(QObject *parent) : QObject(parent) { - } FilterImporterPathCacheTest::~FilterImporterPathCacheTest() { - } void FilterImporterPathCacheTest::shouldReturnEmptyStringWhenListIsEmpty() @@ -66,7 +64,6 @@ void FilterImporterPathCacheTest::shouldNotDuplicateEntries() cache.insert(QStringLiteral("foo1"), Akonadi::Collection(3)); QCOMPARE(cache.count(), 1); - cache.insert(QStringLiteral("foo1"), Akonadi::Collection(4)); QCOMPARE(cache.count(), 1); @@ -76,7 +73,6 @@ void FilterImporterPathCacheTest::shouldNotDuplicateEntries() //Add new one cache.insert(QStringLiteral("foo2"), Akonadi::Collection(4)); QCOMPARE(cache.count(), 2); - } void FilterImporterPathCacheTest::shouldReturnValues() diff --git a/src/filter/filteractions/filteractionwidget.cpp b/src/filter/filteractions/filteractionwidget.cpp index 08b53ab..08c2f71 100644 --- a/src/filter/filteractions/filteractionwidget.cpp +++ b/src/filter/filteractions/filteractionwidget.cpp @@ -177,9 +177,13 @@ FilterActionWidget::FilterActionWidget(QWidget *parent) connect(d->mComboBox, QOverload::of(&KComboBox::activated), this, &FilterActionWidget::filterModified); connect(d->mAdd, &QPushButton::clicked, - this, [this]() { d->slotAddWidget(); }); + this, [this]() { + d->slotAddWidget(); + }); connect(d->mRemove, &QPushButton::clicked, - this, [this]() { d->slotRemoveWidget(); }); + this, [this]() { + d->slotRemoveWidget(); + }); d->setFilterAction(); d->mLayout->addWidget(d->mAdd, 1, 3); diff --git a/src/filter/filterimporterpathcache.cpp b/src/filter/filterimporterpathcache.cpp index 960a132..2c08f40 100644 --- a/src/filter/filterimporterpathcache.cpp +++ b/src/filter/filterimporterpathcache.cpp @@ -21,12 +21,10 @@ using namespace MailCommon; FilterImporterPathCache::FilterImporterPathCache(QObject *parent) : QObject(parent) { - } FilterImporterPathCache::~FilterImporterPathCache() { - } FilterImporterPathCache *FilterImporterPathCache::self() diff --git a/src/filter/filterimporterpathcache.h b/src/filter/filterimporterpathcache.h index c90b702..0eb0f59 100644 --- a/src/filter/filterimporterpathcache.h +++ b/src/filter/filterimporterpathcache.h @@ -22,12 +22,11 @@ #include #include #include "mailcommon_export.h" -namespace MailCommon -{ +namespace MailCommon { class MAILCOMMON_EXPORT FilterImporterPathCache : public QObject { Q_OBJECT -public: +public: static FilterImporterPathCache *self(); explicit FilterImporterPathCache(QObject *parent = nullptr); diff --git a/src/filter/mailfilter.cpp b/src/filter/mailfilter.cpp index a8a055c..afc4e18 100644 --- a/src/filter/mailfilter.cpp +++ b/src/filter/mailfilter.cpp @@ -507,7 +507,9 @@ void MailFilter::generateSieveScript(QStringList &requires, QString &code) QList::const_iterator it; QList::const_iterator end(mActions.constEnd()); - const QString indentationStr{QStringLiteral(" ")}; + const QString indentationStr{ + QStringLiteral(" ") + }; code += QLatin1String(")\n{\n"); bool firstAction = true; for (it = mActions.constBegin(); it != end; ++it) { @@ -680,7 +682,6 @@ const QString MailFilter::asString() const } else if (bApplyOnInbound && mApplicability == ButImap) { result += QStringLiteral("This filter applies to all but IMAP accounts.\n"); } else if (bApplyOnInbound) { - result += QStringLiteral("This filter applies to the following accounts:"); if (mAccounts.isEmpty()) { result += QStringLiteral(" None"); diff --git a/src/search/searchpatternedit.cpp b/src/search/searchpatternedit.cpp index de84fd7..a753c5f 100644 --- a/src/search/searchpatternedit.cpp +++ b/src/search/searchpatternedit.cpp @@ -642,7 +642,7 @@ void SearchPatternEdit::initLayout(SearchPatternEditOptions options, SearchModeT } //------------connect a few signals - connect(bg, QOverload::of(&QButtonGroup::buttonClicked), + connect(bg, QOverload::of(&QButtonGroup::buttonClicked), this, &SearchPatternEdit::slotRadioClicked); //------------the list of SearchRuleWidget's @@ -667,7 +667,7 @@ void SearchPatternEdit::initLayout(SearchPatternEditOptions options, SearchModeT qCDebug(MAILCOMMON_LOG) << "No first SearchRuleWidget, though slotClear() has been called!"; } - connect(mRuleLister, QOverload::of(&SearchRuleWidgetLister::widgetAdded), + connect(mRuleLister, QOverload::of(&SearchRuleWidgetLister::widgetAdded), this, &SearchPatternEdit::slotRuleAdded); connect(mRuleLister, QOverload<>::of(&SearchRuleWidgetLister::widgetRemoved), this, &SearchPatternEdit::patternChanged); connect(mRuleLister, &KPIM::KWidgetLister::clearWidgets, this, &SearchPatternEdit::patternChanged); diff --git a/src/snippets/snippetsmanager.cpp b/src/snippets/snippetsmanager.cpp index fbf95f2..76a8b78 100644 --- a/src/snippets/snippetsmanager.cpp +++ b/src/snippets/snippetsmanager.cpp @@ -399,7 +399,9 @@ void SnippetsManager::Private::updateActionCollection(const QString &oldName, co QAction *action = mActionCollection->addAction(normalizedName, q); - connect(action, &QAction::triggered, q, [this]() {insertActionSnippet();}); + connect(action, &QAction::triggered, q, [this]() { + insertActionSnippet(); + }); action->setProperty("snippetText", text); action->setText(actionName); mActionCollection->setDefaultShortcut(action, keySequence);