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

Modernize code

parent de3bb0c7
Pipeline #33290 passed with stage
in 18 minutes and 51 seconds
......@@ -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)
......
......@@ -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;
};
......
......@@ -139,7 +139,7 @@ public:
private:
class Private;
Private *d;
Private *const d;
};
}
}
......
......@@ -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<Term> m_subTerms;
QVariantHash m_userData;
Private()
{
m_op = None;
m_comp = Auto;
m_isNegated = false;
}
};
Term::Term()
......
......@@ -115,7 +115,7 @@ public:
private:
class Private;
Private *d;
Private *const d;
};
inline Term operator &&(const Term &lhs, const Term &rhs)
......
......@@ -24,11 +24,6 @@ using namespace Akonadi::Search;
class Akonadi::Search::AkonadiSearchDebugDialogPrivate
{
public:
AkonadiSearchDebugDialogPrivate()
: mAkonadiSearchDebugWidget(nullptr)
{
}
AkonadiSearchDebugWidget *mAkonadiSearchDebugWidget = nullptr;
};
......
......@@ -12,7 +12,6 @@
using namespace Akonadi::Search;
AkonadiSearchDebugSearchJob::AkonadiSearchDebugSearchJob(QObject *parent)
: QObject(parent)
, mProcess(nullptr)
{
}
......
......@@ -47,7 +47,7 @@ public:
private:
class Private;
Private *d;
Private *const d;
};
}
}
......
......@@ -35,7 +35,7 @@ public:
private:
class Private;
Private *d;
Private *const d;
};
}
}
......
......@@ -38,7 +38,7 @@ private:
friend class CollectionQuery;
class Private;
Private *d;
Private *const d;
};
}
}
......
......@@ -71,7 +71,7 @@ private:
QVector<uint> m_docsToRemove;
std::string m_path;
bool m_writeOnly = false;
const bool m_writeOnly = false;
Xapian::WritableDatabase createWritableDb();
};
......
......@@ -14,8 +14,6 @@
using namespace Akonadi::Search;
XapianQueryParser::XapianQueryParser()
: m_db(nullptr)
, m_autoExpand(true)
{
}
......
......@@ -37,7 +37,7 @@ public:
private:
Xapian::Database *m_db = nullptr;
bool m_autoExpand;
bool m_autoExpand = true;
};
}
}
......
......@@ -22,7 +22,6 @@ XapianSearchStore::XapianSearchStore(QObject *parent)
: SearchStore(parent)
, m_mutex(QMutex::Recursive)
, m_nextId(1)
, m_db(nullptr)
{
}
......
......@@ -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);
......
......@@ -34,7 +34,7 @@ private:
Xapian::Document *m_doc = nullptr;
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