Commit 46dbff22 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compile against qt5.15

parent ed6a521c
......@@ -7,7 +7,9 @@
#include <QThread>
#include <QMetaMethod>
#include <QDebug>
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
#include <QDeadlineTimer>
#endif
DictionaryMatchEngine::DictionaryMatchEngine(Plasma::DataEngine *dictionaryEngine, QObject *parent)
: QObject(parent),
m_dictionaryEngine(dictionaryEngine)
......@@ -39,7 +41,11 @@ QString DictionaryMatchEngine::lookupWord(const QString &word)
QMetaObject::invokeMethod(this, "sourceAdded", Qt::QueuedConnection, Q_ARG(const QString&, word));
QMutexLocker locker(&data.mutex);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
if (!data.waitCondition.wait(&data.mutex, 30 * 1000)) // Timeout after 30 seconds
#else
if (!data.waitCondition.wait(&data.mutex, QDeadlineTimer(30 * 1000))) // Timeout after 30 seconds
#endif
qDebug() << "The dictionary data engine timed out (word:" << word << ")";
locker.unlock();
......
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