From kde-commits Tue Oct 31 21:33:02 2017 From: Montel Laurent Date: Tue, 31 Oct 2017 21:33:02 +0000 To: kde-commits Subject: [mailcommon] /: GIT_SILENT: coding style (silent) Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=150948559328291 Git commit b03dc485c875b7943dec8534267a5b7df09e73d4 by Montel Laurent. Committed on 31/10/2017 at 21:33. Pushed by mlaurent into branch 'master'. GIT_SILENT: coding style M +0 -1 autotests/dummykernel.cpp M +2 -4 autotests/dummykernel.h M +12 -4 autotests/foldertreewidgettest.cpp M +0 -4 src/filter/autotests/filterimporterpathcachetest.cpp M +6 -2 src/filter/filteractions/filteractionwidget.cpp M +0 -2 src/filter/filterimporterpathcache.cpp M +2 -3 src/filter/filterimporterpathcache.h M +3 -2 src/filter/mailfilter.cpp M +2 -2 src/search/searchpatternedit.cpp M +3 -1 src/snippets/snippetsmanager.cpp https://commits.kde.org/mailcommon/b03dc485c875b7943dec8534267a5b7df09e73d4 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::Collec= tion::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/foldertreewidge= ttest.cpp index 4bc1a53..357cdf5 100644 --- a/autotests/foldertreewidgettest.cpp +++ b/autotests/foldertreewidgettest.cpp @@ -68,7 +68,9 @@ private Q_SLOTS: CommonKernel->registerSettingsIf(kernel); = mFolderTreeWidget =3D new MailCommon::FolderTreeWidget(nullptr); - const QStringList resourceOrder{"akonadi_knut_resource_2", "akonad= i_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(resourceOr= der); = mCollectionModel =3D KernelIf->collectionModel(); @@ -77,7 +79,9 @@ private Q_SLOTS: // One knut resource is already defined in the unittestenv, so tha= t it's below "Search" in the ETM. QTRY_COMPARE(mCollectionModel->rowCount(), 2); QCOMPARE(mTopModel->rowCount(), 1); // Search doesn't appear yet - mFolderNames =3D QStringList{"res1"}; + mFolderNames =3D 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 =3D AgentManager::self()->type(QStringLi= teral("akonadi_knut_resource")); QVERIFY(agentType.isValid()); - mFolderNames =3D QStringList{"res3", "res1", "res2"}; // according= to resourceOrder above (the folder names are defined in testdata-res*.xml) + mFolderNames =3D QStringList{ + "res3", "res1", "res2" + }; // according t= o resourceOrder above (the folder names are defined in testdata-res*.xml) = // Create resources const int numResources =3D numFolders.count(); diff --git a/src/filter/autotests/filterimporterpathcachetest.cpp b/src/fil= ter/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::shouldNotDuplicateEntri= es() 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::shouldNotDuplicateEntri= es() //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/f= ilteractions/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/filterimpo= rterpathcache.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/filterimport= erpathcache.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 =3D 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 &requi= res, QString &code) QList::const_iterator it; QList::const_iterator end(mActions.constEnd()); = - const QString indentationStr{QStringLiteral(" ")}; + const QString indentationStr{ + QStringLiteral(" ") + }; code +=3D QLatin1String(")\n{\n"); bool firstAction =3D true; for (it =3D mActions.constBegin(); it !=3D end; ++it) { @@ -680,7 +682,6 @@ const QString MailFilter::asString() const } else if (bApplyOnInbound && mApplicability =3D=3D ButImap) { result +=3D QStringLiteral("This filter applies to all but IMAP ac= counts.\n"); } else if (bApplyOnInbound) { - result +=3D QStringLiteral("This filter applies to the following a= ccounts:"); if (mAccounts.isEmpty()) { result +=3D QStringLiteral(" None"); diff --git a/src/search/searchpatternedit.cpp b/src/search/searchpatternedi= t.cpp index de84fd7..a753c5f 100644 --- a/src/search/searchpatternedit.cpp +++ b/src/search/searchpatternedit.cpp @@ -642,7 +642,7 @@ void SearchPatternEdit::initLayout(SearchPatternEditOpt= ions options, SearchModeT } = //------------connect a few signals - connect(bg, QOverload::of(&QButtonGroup::buttonClick= ed), + connect(bg, QOverload::of(&QButtonGroup::buttonClic= ked), this, &SearchPatternEdit::slotRadioClicked); = //------------the list of SearchRuleWidget's @@ -667,7 +667,7 @@ void SearchPatternEdit::initLayout(SearchPatternEditOpt= ions options, SearchModeT qCDebug(MAILCOMMON_LOG) << "No first SearchRuleWidget, though slot= Clear() has been called!"; } = - connect(mRuleLister, QOverload::of(&SearchRuleWidgetLister::= widgetAdded), + connect(mRuleLister, QOverload::of(&SearchRuleWidgetLister:= :widgetAdded), this, &SearchPatternEdit::slotRuleAdded); connect(mRuleLister, QOverload<>::of(&SearchRuleWidgetLister::widgetRe= moved), this, &SearchPatternEdit::patternChanged); connect(mRuleLister, &KPIM::KWidgetLister::clearWidgets, this, &Search= PatternEdit::patternChanged); diff --git a/src/snippets/snippetsmanager.cpp b/src/snippets/snippetsmanage= r.cpp index fbf95f2..76a8b78 100644 --- a/src/snippets/snippetsmanager.cpp +++ b/src/snippets/snippetsmanager.cpp @@ -399,7 +399,9 @@ void SnippetsManager::Private::updateActionCollection(c= onst QString &oldName, co = QAction *action =3D mActionCollection->addAction(normalizedName, q); - connect(action, &QAction::triggered, q, [this]() {insertActionSnip= pet();}); + connect(action, &QAction::triggered, q, [this]() { + insertActionSnippet(); + }); action->setProperty("snippetText", text); action->setText(actionName); mActionCollection->setDefaultShortcut(action, keySequence);