Fix some warning found by clazy

wilder
Laurent Montel 7 years ago
parent 8088bae0ab
commit bb97a99451
  1. 1
      agents/archivemailagent/archivemailkernel.h
  2. 1
      agents/mailfilteragent/dummykernel.h
  3. 3
      agents/sendlateragent/autotests/sendlaterinfotest.cpp
  4. 2
      agents/sendlateragent/autotests/sendlaterinfotest.h
  5. 4
      agents/unifiedmailboxagent/unifiedmailbox.cpp
  6. 3
      src/autotests/displaymessageformatactionmenutest.cpp
  7. 2
      src/autotests/displaymessageformatactionmenutest.h
  8. 2
      src/editor/kmcomposerwin.cpp
  9. 2
      src/identity/identitydialog.cpp
  10. 6
      src/kmreaderwin.cpp
  11. 1
      src/kontactplugin/summary/kcmkontactsummary.cpp
  12. 2
      src/kontactplugin/summary/summaryview_part.cpp
  13. 2
      src/searchdialog/incompleteindexdialog.cpp
  14. 2
      src/sieveimapinterface/kmailsieveimapinstanceinterface.h

@ -34,6 +34,7 @@ class JobScheduler;
class ArchiveMailKernel : public QObject, public MailCommon::IKernel, public MailCommon::ISettings class ArchiveMailKernel : public QObject, public MailCommon::IKernel, public MailCommon::ISettings
{ {
Q_OBJECT
public: public:
explicit ArchiveMailKernel(QObject *parent = nullptr); explicit ArchiveMailKernel(QObject *parent = nullptr);

@ -14,6 +14,7 @@ class FolderCollectionMonitor;
class DummyKernel : public QObject, public MailCommon::IKernel, public MailCommon::ISettings class DummyKernel : public QObject, public MailCommon::IKernel, public MailCommon::ISettings
{ {
Q_OBJECT
public: public:
explicit DummyKernel(QObject *parent = nullptr); explicit DummyKernel(QObject *parent = nullptr);

@ -25,7 +25,8 @@
#include <KSharedConfig> #include <KSharedConfig>
#include <QStandardPaths> #include <QStandardPaths>
SendLaterInfoTest::SendLaterInfoTest() SendLaterInfoTest::SendLaterInfoTest(QObject *parent)
: QObject(parent)
{ {
QStandardPaths::setTestModeEnabled(true); QStandardPaths::setTestModeEnabled(true);
} }

@ -26,7 +26,7 @@ class SendLaterInfoTest : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
SendLaterInfoTest(); explicit SendLaterInfoTest(QObject *parent = nullptr);
private Q_SLOTS: private Q_SLOTS:
void shouldHaveDefaultValue(); void shouldHaveDefaultValue();

@ -137,12 +137,12 @@ void UnifiedMailbox::attachManager(UnifiedMailboxManager *manager)
if (mManager != manager) { if (mManager != manager) {
if (manager) { if (manager) {
// Force that we start monitoring all the collections // Force that we start monitoring all the collections
for (auto source : mSources) { for (const auto source : qAsConst(mSources)) {
manager->mMonitor.setCollectionMonitored(Akonadi::Collection{source}); manager->mMonitor.setCollectionMonitored(Akonadi::Collection{source});
manager->mSourceToBoxMap.insert({ source, this }); manager->mSourceToBoxMap.insert({ source, this });
} }
} else { } else {
for (auto source : mSources) { for (const auto source : qAsConst(mSources)) {
mManager->mMonitor.setCollectionMonitored(Akonadi::Collection{source}, false); mManager->mMonitor.setCollectionMonitored(Akonadi::Collection{source}, false);
mManager->mSourceToBoxMap.erase(source); mManager->mSourceToBoxMap.erase(source);
} }

@ -23,7 +23,8 @@
#include <KToggleAction> #include <KToggleAction>
#include <QSignalSpy> #include <QSignalSpy>
Q_DECLARE_METATYPE(MessageViewer::Viewer::DisplayFormatMessage) Q_DECLARE_METATYPE(MessageViewer::Viewer::DisplayFormatMessage)
DisplayMessageFormatActionMenuTest::DisplayMessageFormatActionMenuTest() DisplayMessageFormatActionMenuTest::DisplayMessageFormatActionMenuTest(QObject *parent)
: QObject(parent)
{ {
qRegisterMetaType<MessageViewer::Viewer::DisplayFormatMessage >(); qRegisterMetaType<MessageViewer::Viewer::DisplayFormatMessage >();
} }

@ -24,7 +24,7 @@ class DisplayMessageFormatActionMenuTest : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
DisplayMessageFormatActionMenuTest(); explicit DisplayMessageFormatActionMenuTest(QObject *parent = nullptr);
private Q_SLOTS: private Q_SLOTS:
void shouldHaveDefaultValue(); void shouldHaveDefaultValue();
void shouldEmitSignalWhenClickOnSubMenu(); void shouldEmitSignalWhenClickOnSubMenu();

@ -362,7 +362,7 @@ KMComposerWin::KMComposerWin(const KMime::Message::Ptr &aMsg, bool lastSignState
mRichTextEditorwidget = new KPIMTextEdit::RichTextEditorWidget(composerEditorNg, mCryptoStateIndicatorWidget); mRichTextEditorwidget = new KPIMTextEdit::RichTextEditorWidget(composerEditorNg, mCryptoStateIndicatorWidget);
//Don't use new connect api here. It crashs //Don't use new connect api here. It crashs
connect(composerEditorNg, SIGNAL(textChanged()), this, SLOT(slotEditorTextChanged())); connect(composerEditorNg, &QTextEdit::textChanged, this, &KMComposerWin::slotEditorTextChanged);
connect(composerEditorNg, &KMComposerEditorNg::selectionChanged, this, &KMComposerWin::slotSelectionChanged); connect(composerEditorNg, &KMComposerEditorNg::selectionChanged, this, &KMComposerWin::slotSelectionChanged);
//connect(editor, &KMComposerEditor::textChanged, this, &KMComposeWin::slotEditorTextChanged); //connect(editor, &KMComposerEditor::textChanged, this, &KMComposeWin::slotEditorTextChanged);
mComposerBase->setEditor(composerEditorNg); mComposerBase->setEditor(composerEditorNg);

@ -975,7 +975,7 @@ void IdentityDialog::unregisterSpecialCollection(qint64 colId)
// resource set as well. // resource set as well.
auto fetch = new Akonadi::CollectionFetchJob(Akonadi::Collection(colId), Akonadi::CollectionFetchJob::Base, this); auto fetch = new Akonadi::CollectionFetchJob(Akonadi::Collection(colId), Akonadi::CollectionFetchJob::Base, this);
connect(fetch, &Akonadi::CollectionFetchJob::collectionsReceived, connect(fetch, &Akonadi::CollectionFetchJob::collectionsReceived,
this, [this](const Akonadi::Collection::List &cols) { this, [](const Akonadi::Collection::List &cols) {
if (cols.count() != 1) { if (cols.count() != 1) {
return; return;
} }

@ -290,13 +290,13 @@ QString KMReaderWin::newFeaturesMD5()
void KMReaderWin::displaySplashPage(const QString &templateName, const QVariantHash &_data) void KMReaderWin::displaySplashPage(const QString &templateName, const QVariantHash &_data)
{ {
QVariantHash data = _data; QVariantHash data = _data;
if (!data.contains(QLatin1String("icon"))) { if (!data.contains(QStringLiteral("icon"))) {
data[QStringLiteral("icon")] = QStringLiteral("kmail"); data[QStringLiteral("icon")] = QStringLiteral("kmail");
} }
if (!data.contains(QLatin1String("name"))) { if (!data.contains(QStringLiteral("name"))) {
data[QStringLiteral("name")] = i18n("KMail"); data[QStringLiteral("name")] = i18n("KMail");
} }
if (!data.contains(QLatin1String("subtitle"))) { if (!data.contains(QStringLiteral("subtitle"))) {
data[QStringLiteral("subtitle")] = i18n("The KDE Mail Client"); data[QStringLiteral("subtitle")] = i18n("The KDE Mail Client");
} }

@ -76,6 +76,7 @@ public:
} }
private: private:
Q_DISABLE_COPY(PluginItem)
KPluginInfo mInfo; KPluginInfo mInfo;
}; };

@ -435,7 +435,7 @@ void SummaryViewPart::slotConfigure()
dlg->setModal(true); dlg->setModal(true);
QStringList modules = configModules(); QStringList modules = configModules();
modules.prepend(QLatin1String("kcmkontactsummary.desktop")); modules.prepend(QStringLiteral("kcmkontactsummary.desktop"));
connect(dlg.data(), QOverload<>::of(&KCMultiDialog::configCommitted), connect(dlg.data(), QOverload<>::of(&KCMultiDialog::configCommitted),
this, &SummaryViewPart::updateWidgets); this, &SummaryViewPart::updateWidgets);

@ -203,7 +203,7 @@ QList<qlonglong> IncompleteIndexDialog::collectionsToReindex() const
void IncompleteIndexDialog::waitForIndexer() void IncompleteIndexDialog::waitForIndexer()
{ {
mIndexer = new QDBusInterface(PimCommon::MailUtil::indexerServiceName(), QLatin1String("/"), mIndexer = new QDBusInterface(PimCommon::MailUtil::indexerServiceName(), QStringLiteral("/"),
QStringLiteral("org.freedesktop.Akonadi.Indexer"), QStringLiteral("org.freedesktop.Akonadi.Indexer"),
QDBusConnection::sessionBus(), this); QDBusConnection::sessionBus(), this);

@ -29,6 +29,8 @@ public:
~KMailSieveImapInstanceInterface() override = default; ~KMailSieveImapInstanceInterface() override = default;
QVector<KSieveUi::SieveImapInstance> sieveImapInstances() override; QVector<KSieveUi::SieveImapInstance> sieveImapInstances() override;
private:
Q_DISABLE_COPY(KMailSieveImapInstanceInterface)
}; };
#endif // KMAILSIEVEIMAPINSTANCEINTERFACE_H #endif // KMAILSIEVEIMAPINSTANCEINTERFACE_H

Loading…
Cancel
Save