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

Port toSet deprecated method

parent 50c4d517
...@@ -47,7 +47,11 @@ public: ...@@ -47,7 +47,11 @@ public:
void findIndexed(QSet< Akonadi::Item::Id> &indexed, Akonadi::Collection::Id) override void findIndexed(QSet< Akonadi::Item::Id> &indexed, Akonadi::Collection::Id) override
{ {
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
indexed = alreadyIndexed.toSet(); indexed = alreadyIndexed.toSet();
#else
indexed = QSet< Akonadi::Item::Id>(alreadyIndexed.begin(), alreadyIndexed.end());
#endif
} }
void index(const Akonadi::Item &item) override void index(const Akonadi::Item &item) override
......
...@@ -59,13 +59,23 @@ Scheduler::Scheduler(Index &index, const KSharedConfigPtr &config, const QShared ...@@ -59,13 +59,23 @@ Scheduler::Scheduler(Index &index, const KSharedConfigPtr &config, const QShared
connect(&m_processTimer, &QTimer::timeout, this, &Scheduler::processNext); connect(&m_processTimer, &QTimer::timeout, this, &Scheduler::processNext);
KConfigGroup cfg = m_config->group("General"); KConfigGroup cfg = m_config->group("General");
m_dirtyCollections = cfg.readEntry("dirtyCollections", QList<Akonadi::Collection::Id>()).toSet(); const auto dirtyCollectionsResult2 = cfg.readEntry("dirtyCollections", QList<Akonadi::Collection::Id>());
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
m_dirtyCollections = dirtyCollectionsResult2.toSet();
#else
m_dirtyCollections = QSet<Akonadi::Collection::Id>(dirtyCollectionsResult2.begin(), dirtyCollectionsResult2.end());
#endif
if (m_dirtyCollections.isEmpty()) { if (m_dirtyCollections.isEmpty()) {
KConfig baloorc(Akonadi::ServerManager::addNamespace(QStringLiteral("baloorc"))); KConfig baloorc(Akonadi::ServerManager::addNamespace(QStringLiteral("baloorc")));
KConfigGroup baloorcGroup = baloorc.group("Akonadi"); KConfigGroup baloorcGroup = baloorc.group("Akonadi");
//Schedule collections we know have missing items from last time //Schedule collections we know have missing items from last time
m_dirtyCollections = baloorcGroup.readEntry("dirtyCollections", QList<Akonadi::Collection::Id>()).toSet(); const auto dirtyCollectionsResult = baloorcGroup.readEntry("dirtyCollections", QList<Akonadi::Collection::Id>());
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
m_dirtyCollections = dirtyCollectionsResult.toSet();
#else
m_dirtyCollections = QSet<Akonadi::Collection::Id>(dirtyCollectionsResult.begin(), dirtyCollectionsResult.end());
#endif
} }
qCDebug(AKONADI_INDEXER_AGENT_LOG) << "Dirty collections " << m_dirtyCollections; qCDebug(AKONADI_INDEXER_AGENT_LOG) << "Dirty collections " << m_dirtyCollections;
......
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