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

Port some deprecated methods

parent 24a83951
......@@ -42,7 +42,7 @@ bool SetupTest::startAkonadiDaemon()
if (!mAkonadiDaemonProcess) {
mAkonadiDaemonProcess = new KProcess(this);
connect(mAkonadiDaemonProcess, QOverload<int>::of(&KProcess::finished),
connect(mAkonadiDaemonProcess, QOverload<int, QProcess::ExitStatus>::of(&KProcess::finished),
this, &SetupTest::slotAkonadiDaemonProcessFinished);
}
......
......@@ -39,7 +39,7 @@ void TestRunner::run()
qCDebug(AKONADITEST_LOG) << "Starting test" << mArguments;
mProcess = new KProcess(this);
mProcess->setProgram(mArguments);
connect(mProcess, QOverload<int>::of(&KProcess::finished), this, &TestRunner::processFinished);
connect(mProcess, QOverload<int, QProcess::ExitStatus>::of(&KProcess::finished), this, &TestRunner::processFinished);
connect(mProcess, &KProcess::errorOccurred,
this, &TestRunner::processError);
// environment setup seems to have been done by setuptest globally already
......
......@@ -32,6 +32,7 @@
#include <KLocalizedString>
#include <QTimer>
#include <QElapsedTimer>
#include <QDBusInterface>
#include <QDBusConnectionInterface>
......@@ -114,9 +115,9 @@ void JobPrivate::publishJob()
if (!s_jobtracker) {
// Let's only check for the debugging console every 3 seconds, otherwise every single job
// makes a dbus call to the dbus daemon, doesn't help performance.
static QTime s_lastTime;
if (s_lastTime.isNull() || s_lastTime.elapsed() > 3000) {
if (s_lastTime.isNull()) {
static QElapsedTimer s_lastTime;
if (!s_lastTime.isValid() || s_lastTime.elapsed() > 3000) {
if (!s_lastTime.isValid()) {
s_lastTime.start();
}
const QString suffix = Akonadi::Instance::identifier().isEmpty() ? QString() : QLatin1Char('-') + Akonadi::Instance::identifier();
......
......@@ -359,7 +359,7 @@ static QSet<Collection::Id> getChildren(Collection::Id parent, const QHash<Colle
void EntityTreeModelPrivate::collectionsFetched(const Akonadi::Collection::List &collections)
{
Q_Q(EntityTreeModel);
QTime t;
QElapsedTimer t;
t.start();
QVectorIterator<Akonadi::Collection> it(collections);
......
......@@ -49,8 +49,7 @@ using namespace Akonadi::Server;
#define IDLE_TIMER_TIMEOUT 180000 // 3 min
static QString connectionIdentifier(Connection *c) {
QString id;
id.sprintf("%p", static_cast<void *>(c));
const QString id = QString::asprintf("%p", static_cast<void *>(c));
return id;
}
......@@ -412,7 +411,7 @@ void Connection::setState(ConnectionState state)
void Connection::setSessionId(const QByteArray &id)
{
m_identifier.sprintf("%s (%p)", id.data(), static_cast<void *>(this));
m_identifier = QString::asprintf("%s (%p)", id.data(), static_cast<void *>(this));
Tracer::self()->beginConnection(m_identifier, QString());
//m_streamParser->setTracerIdentifier(m_identifier);
......
......@@ -30,7 +30,9 @@
#include <QSqlError>
#include <QTimer>
#include <QTime>
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
#include <QDeadlineTimer>
#endif
using namespace Akonadi;
using namespace Akonadi::Server;
......@@ -218,8 +220,11 @@ void SearchTaskManager::searchLoop()
Q_FOREVER {
qCDebug(AKONADISERVER_SEARCH_LOG) << "Search loop is waiting, will wake again in" << timeout << "ms";
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
mWait.wait(&mLock, timeout);
#else
mWait.wait(&mLock, QDeadlineTimer(QDeadlineTimer::Forever));
#endif
if (mShouldStop) {
Q_FOREACH (SearchTask *task, mTasklist) {
QMutexLocker locker(&task->sharedLock);
......
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