diff --git a/agent/akonotesindexer.cpp b/agent/akonotesindexer.cpp index 9207fe34a9d7f3e119172f6887f526f9336d6ad6..bf707b43fec618a585e3b62570de812986dabc58 100644 --- a/agent/akonotesindexer.cpp +++ b/agent/akonotesindexer.cpp @@ -33,7 +33,7 @@ AkonotesIndexer::~AkonotesIndexer() QStringList AkonotesIndexer::mimeTypes() const { - return QStringList() << QStringLiteral("text/x-vnd.akonadi.note"); + return {QStringLiteral("text/x-vnd.akonadi.note")}; } void AkonotesIndexer::index(const Akonadi::Item &item) diff --git a/agent/scheduler.cpp b/agent/scheduler.cpp index 268c60b9fb51c32f7b719483fc5c15439e1def37..5520b4eca01c1ddf98230a68f4a9cfac2bba10f0 100644 --- a/agent/scheduler.cpp +++ b/agent/scheduler.cpp @@ -30,7 +30,7 @@ CollectionIndexingJob *JobFactory::createCollectionIndexingJob(Index &index, con } Scheduler::Scheduler(Index &index, const KSharedConfigPtr &config, const QSharedPointer &jobFactory, QObject *parent) - : QObject(parent) + : QObject(parent) , m_config(config) , m_index(index) , m_jobFactory(jobFactory) diff --git a/core/query.cpp b/core/query.cpp index 15e5d55e8414b9afcf9321cf5284b82bb0c2b036..973197b86ebcc1db7e2b73b18b928947f699cbfb 100644 --- a/core/query.cpp +++ b/core/query.cpp @@ -26,28 +26,18 @@ const int defaultLimit = 100000; class Q_DECL_HIDDEN Akonadi::Search::Query::Private { public: - Private() - { - m_limit = defaultLimit; - m_offset = 0; - m_yearFilter = -1; - m_monthFilter = -1; - m_dayFilter = -1; - m_sortingOption = SortAuto; - } - Term m_term; QStringList m_types; QString m_searchString; - uint m_limit; - uint m_offset; + uint m_limit = defaultLimit; + uint m_offset = 0; - int m_yearFilter; - int m_monthFilter; - int m_dayFilter; + int m_yearFilter = -1; + int m_monthFilter = -1; + int m_dayFilter = -1; - SortingOption m_sortingOption; + SortingOption m_sortingOption = SortAuto; QString m_sortingProperty; QVariantMap m_customOptions; }; diff --git a/core/query.h b/core/query.h index cba391500821dbbe5f83a71b8f4c985038c62e66..6dff8ccf3d32e7bb0232a8cd93b6829c7b31b4eb 100644 --- a/core/query.h +++ b/core/query.h @@ -139,7 +139,7 @@ public: private: class Private; - Private *d; + Private *const d; }; } } diff --git a/core/term.cpp b/core/term.cpp index ee9a35d510855152619410a14475f0d627aa80f7..28f489ad313dbb9d633182bfdbce283268bf4146 100644 --- a/core/term.cpp +++ b/core/term.cpp @@ -16,23 +16,16 @@ using namespace Akonadi::Search; class Q_DECL_HIDDEN Akonadi::Search::Term::Private { public: - Operation m_op; - Comparator m_comp; + Operation m_op = None; + Comparator m_comp = Auto; QString m_property; QVariant m_value; - bool m_isNegated; + bool m_isNegated = false; QList m_subTerms; QVariantHash m_userData; - - Private() - { - m_op = None; - m_comp = Auto; - m_isNegated = false; - } }; Term::Term() diff --git a/core/term.h b/core/term.h index d12d4891eb5d4a523735cf3f7a93dd3b6e693e57..624f31be84f80c4f5997f0e8e1af2eb35ded1385 100644 --- a/core/term.h +++ b/core/term.h @@ -115,7 +115,7 @@ public: private: class Private; - Private *d; + Private *const d; }; inline Term operator &&(const Term &lhs, const Term &rhs) diff --git a/debug/akonadisearchdebugdialog.cpp b/debug/akonadisearchdebugdialog.cpp index b50a61b0ee5f21cf3f063f03f2ce7c526dd9be2e..5c79446152d0781b9f36eb32778774858c872521 100644 --- a/debug/akonadisearchdebugdialog.cpp +++ b/debug/akonadisearchdebugdialog.cpp @@ -24,11 +24,6 @@ using namespace Akonadi::Search; class Akonadi::Search::AkonadiSearchDebugDialogPrivate { public: - AkonadiSearchDebugDialogPrivate() - : mAkonadiSearchDebugWidget(nullptr) - { - } - AkonadiSearchDebugWidget *mAkonadiSearchDebugWidget = nullptr; }; diff --git a/debug/job/akonadisearchdebugsearchjob.cpp b/debug/job/akonadisearchdebugsearchjob.cpp index e765a82c2b55d9da51a1a090b5227964b62f1025..4e6b4d14da9daf6f6ff77a32b11a107fe9cb9f8e 100644 --- a/debug/job/akonadisearchdebugsearchjob.cpp +++ b/debug/job/akonadisearchdebugsearchjob.cpp @@ -12,7 +12,6 @@ using namespace Akonadi::Search; AkonadiSearchDebugSearchJob::AkonadiSearchDebugSearchJob(QObject *parent) : QObject(parent) - , mProcess(nullptr) { } diff --git a/lib/contactquery.h b/lib/contactquery.h index c7888e72bf09f8fc38a3d44274b3f10be4c5dcc7..5c43bdeb57eb4a22042ffea65ca27a88c1316036 100644 --- a/lib/contactquery.h +++ b/lib/contactquery.h @@ -47,7 +47,7 @@ public: private: class Private; - Private *d; + Private *const d; }; } } diff --git a/lib/notequery.h b/lib/notequery.h index e230ecb78579dcd10229872a0b11947cb20f9849..e6eda50417c1f8eb322612dcc18ce7d43204b4b8 100644 --- a/lib/notequery.h +++ b/lib/notequery.h @@ -35,7 +35,7 @@ public: private: class Private; - Private *d; + Private *const d; }; } } diff --git a/lib/resultiterator.h b/lib/resultiterator.h index d1ae6ccb3ad0153c572aa3c4e7724de938e63d2e..8660eba060a8266fd6e012258a70b2ea166efaf8 100644 --- a/lib/resultiterator.h +++ b/lib/resultiterator.h @@ -38,7 +38,7 @@ private: friend class CollectionQuery; class Private; - Private *d; + Private *const d; }; } } diff --git a/xapian/xapiandatabase.h b/xapian/xapiandatabase.h index 147ed4e3d7e123fa5dfb948e5652d663a548a19c..f2319ec1405db341b4a37ae274f105401478f685 100644 --- a/xapian/xapiandatabase.h +++ b/xapian/xapiandatabase.h @@ -71,7 +71,7 @@ private: QVector m_docsToRemove; std::string m_path; - bool m_writeOnly = false; + const bool m_writeOnly = false; Xapian::WritableDatabase createWritableDb(); }; diff --git a/xapian/xapianqueryparser.cpp b/xapian/xapianqueryparser.cpp index d8a01b2ded0a0073fb8d1a4ffa2e4aaf465405de..ece29f63c7a6c58ac7e05fc5b3d54e1704d55578 100644 --- a/xapian/xapianqueryparser.cpp +++ b/xapian/xapianqueryparser.cpp @@ -14,8 +14,6 @@ using namespace Akonadi::Search; XapianQueryParser::XapianQueryParser() - : m_db(nullptr) - , m_autoExpand(true) { } diff --git a/xapian/xapianqueryparser.h b/xapian/xapianqueryparser.h index aa99b3ae361f60a95e7b606d2e6950a27e3b7058..f8bffc64df089cac6553076a8de53f4ddb8ea679 100644 --- a/xapian/xapianqueryparser.h +++ b/xapian/xapianqueryparser.h @@ -37,7 +37,7 @@ public: private: Xapian::Database *m_db = nullptr; - bool m_autoExpand; + bool m_autoExpand = true; }; } } diff --git a/xapian/xapiansearchstore.cpp b/xapian/xapiansearchstore.cpp index 590c2edf5fe101f3c30674f9b27af8899274e9a7..55aba931f20d2f5f8971249b25a3e0cd1dd74f20 100644 --- a/xapian/xapiansearchstore.cpp +++ b/xapian/xapiansearchstore.cpp @@ -22,7 +22,6 @@ XapianSearchStore::XapianSearchStore(QObject *parent) : SearchStore(parent) , m_mutex(QMutex::Recursive) , m_nextId(1) - , m_db(nullptr) { } diff --git a/xapian/xapiantermgenerator.cpp b/xapian/xapiantermgenerator.cpp index d9f96772cccc95f48257ba76250e41da95992a92..a795c21448f88bdaf8ec908e5ea600c9a3d7a5e8 100644 --- a/xapian/xapiantermgenerator.cpp +++ b/xapian/xapiantermgenerator.cpp @@ -14,7 +14,6 @@ using namespace Akonadi::Search; XapianTermGenerator::XapianTermGenerator(Xapian::Document *doc) : m_doc(doc) - , m_position(1) { if (doc) { m_termGen.set_document(*doc); diff --git a/xapian/xapiantermgenerator.h b/xapian/xapiantermgenerator.h index addb26761cbc19b37968184c0809d592a680f32c..0f57a83952ddafcb46307f0e457bae679a2dc083 100644 --- a/xapian/xapiantermgenerator.h +++ b/xapian/xapiantermgenerator.h @@ -34,7 +34,7 @@ private: Xapian::Document *m_doc = nullptr; Xapian::TermGenerator m_termGen; - int m_position; + int m_position = 1; }; } }