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

Modernize code

parent de3bb0c7
Pipeline #33290 passed with stage
in 18 minutes and 51 seconds
...@@ -33,7 +33,7 @@ AkonotesIndexer::~AkonotesIndexer() ...@@ -33,7 +33,7 @@ AkonotesIndexer::~AkonotesIndexer()
QStringList AkonotesIndexer::mimeTypes() const 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) void AkonotesIndexer::index(const Akonadi::Item &item)
......
...@@ -26,28 +26,18 @@ const int defaultLimit = 100000; ...@@ -26,28 +26,18 @@ const int defaultLimit = 100000;
class Q_DECL_HIDDEN Akonadi::Search::Query::Private class Q_DECL_HIDDEN Akonadi::Search::Query::Private
{ {
public: public:
Private()
{
m_limit = defaultLimit;
m_offset = 0;
m_yearFilter = -1;
m_monthFilter = -1;
m_dayFilter = -1;
m_sortingOption = SortAuto;
}
Term m_term; Term m_term;
QStringList m_types; QStringList m_types;
QString m_searchString; QString m_searchString;
uint m_limit; uint m_limit = defaultLimit;
uint m_offset; uint m_offset = 0;
int m_yearFilter; int m_yearFilter = -1;
int m_monthFilter; int m_monthFilter = -1;
int m_dayFilter; int m_dayFilter = -1;
SortingOption m_sortingOption; SortingOption m_sortingOption = SortAuto;
QString m_sortingProperty; QString m_sortingProperty;
QVariantMap m_customOptions; QVariantMap m_customOptions;
}; };
......
...@@ -139,7 +139,7 @@ public: ...@@ -139,7 +139,7 @@ public:
private: private:
class Private; class Private;
Private *d; Private *const d;
}; };
} }
} }
......
...@@ -16,23 +16,16 @@ using namespace Akonadi::Search; ...@@ -16,23 +16,16 @@ using namespace Akonadi::Search;
class Q_DECL_HIDDEN Akonadi::Search::Term::Private class Q_DECL_HIDDEN Akonadi::Search::Term::Private
{ {
public: public:
Operation m_op; Operation m_op = None;
Comparator m_comp; Comparator m_comp = Auto;
QString m_property; QString m_property;
QVariant m_value; QVariant m_value;
bool m_isNegated; bool m_isNegated = false;
QList<Term> m_subTerms; QList<Term> m_subTerms;
QVariantHash m_userData; QVariantHash m_userData;
Private()
{
m_op = None;
m_comp = Auto;
m_isNegated = false;
}
}; };
Term::Term() Term::Term()
......
...@@ -115,7 +115,7 @@ public: ...@@ -115,7 +115,7 @@ public:
private: private:
class Private; class Private;
Private *d; Private *const d;
}; };
inline Term operator &&(const Term &lhs, const Term &rhs) inline Term operator &&(const Term &lhs, const Term &rhs)
......
...@@ -24,11 +24,6 @@ using namespace Akonadi::Search; ...@@ -24,11 +24,6 @@ using namespace Akonadi::Search;
class Akonadi::Search::AkonadiSearchDebugDialogPrivate class Akonadi::Search::AkonadiSearchDebugDialogPrivate
{ {
public: public:
AkonadiSearchDebugDialogPrivate()
: mAkonadiSearchDebugWidget(nullptr)
{
}
AkonadiSearchDebugWidget *mAkonadiSearchDebugWidget = nullptr; AkonadiSearchDebugWidget *mAkonadiSearchDebugWidget = nullptr;
}; };
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
using namespace Akonadi::Search; using namespace Akonadi::Search;
AkonadiSearchDebugSearchJob::AkonadiSearchDebugSearchJob(QObject *parent) AkonadiSearchDebugSearchJob::AkonadiSearchDebugSearchJob(QObject *parent)
: QObject(parent) : QObject(parent)
, mProcess(nullptr)
{ {
} }
......
...@@ -47,7 +47,7 @@ public: ...@@ -47,7 +47,7 @@ public:
private: private:
class Private; class Private;
Private *d; Private *const d;
}; };
} }
} }
......
...@@ -35,7 +35,7 @@ public: ...@@ -35,7 +35,7 @@ public:
private: private:
class Private; class Private;
Private *d; Private *const d;
}; };
} }
} }
......
...@@ -38,7 +38,7 @@ private: ...@@ -38,7 +38,7 @@ private:
friend class CollectionQuery; friend class CollectionQuery;
class Private; class Private;
Private *d; Private *const d;
}; };
} }
} }
......
...@@ -71,7 +71,7 @@ private: ...@@ -71,7 +71,7 @@ private:
QVector<uint> m_docsToRemove; QVector<uint> m_docsToRemove;
std::string m_path; std::string m_path;
bool m_writeOnly = false; const bool m_writeOnly = false;
Xapian::WritableDatabase createWritableDb(); Xapian::WritableDatabase createWritableDb();
}; };
......
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
using namespace Akonadi::Search; using namespace Akonadi::Search;
XapianQueryParser::XapianQueryParser() XapianQueryParser::XapianQueryParser()
: m_db(nullptr)
, m_autoExpand(true)
{ {
} }
......
...@@ -37,7 +37,7 @@ public: ...@@ -37,7 +37,7 @@ public:
private: private:
Xapian::Database *m_db = nullptr; Xapian::Database *m_db = nullptr;
bool m_autoExpand; bool m_autoExpand = true;
}; };
} }
} }
......
...@@ -22,7 +22,6 @@ XapianSearchStore::XapianSearchStore(QObject *parent) ...@@ -22,7 +22,6 @@ XapianSearchStore::XapianSearchStore(QObject *parent)
: SearchStore(parent) : SearchStore(parent)
, m_mutex(QMutex::Recursive) , m_mutex(QMutex::Recursive)
, m_nextId(1) , m_nextId(1)
, m_db(nullptr)
{ {
} }
......
...@@ -14,7 +14,6 @@ using namespace Akonadi::Search; ...@@ -14,7 +14,6 @@ using namespace Akonadi::Search;
XapianTermGenerator::XapianTermGenerator(Xapian::Document *doc) XapianTermGenerator::XapianTermGenerator(Xapian::Document *doc)
: m_doc(doc) : m_doc(doc)
, m_position(1)
{ {
if (doc) { if (doc) {
m_termGen.set_document(*doc); m_termGen.set_document(*doc);
......
...@@ -34,7 +34,7 @@ private: ...@@ -34,7 +34,7 @@ private:
Xapian::Document *m_doc = nullptr; Xapian::Document *m_doc = nullptr;
Xapian::TermGenerator m_termGen; Xapian::TermGenerator m_termGen;
int m_position; int m_position = 1;
}; };
} }
} }
......
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