From ebf6ba9ca104cde9defc38546153b9ed6fd66efd Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Sat, 30 Jan 2021 14:27:25 +0100 Subject: [PATCH] Use new connect syntax in DoAfter() --- ext/libstrawberry-common/core/closure.cpp | 2 +- ext/libstrawberry-common/core/closure.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/libstrawberry-common/core/closure.cpp b/ext/libstrawberry-common/core/closure.cpp index 10afd5a05..7bf1270a4 100644 --- a/ext/libstrawberry-common/core/closure.cpp +++ b/ext/libstrawberry-common/core/closure.cpp @@ -64,7 +64,7 @@ void Unpack(QList*) {} } // namespace _detail -_detail::ClosureBase* NewClosure(QObject *sender, const char *signal, std::function callback) { +_detail::ClosureBase *NewClosure(QObject *sender, const char *signal, std::function callback) { return new _detail::CallbackClosure(sender, signal, callback); } diff --git a/ext/libstrawberry-common/core/closure.h b/ext/libstrawberry-common/core/closure.h index 98b5490f6..3888885c7 100644 --- a/ext/libstrawberry-common/core/closure.h +++ b/ext/libstrawberry-common/core/closure.h @@ -227,7 +227,7 @@ template void DoAfter(std::function callback, std::chrono::duration duration) { QTimer *timer = new QTimer; timer->setSingleShot(true); - NewClosure(timer, SIGNAL(timeout()), callback); + QObject::connect(timer, &QTimer::timeout, callback); QObject::connect(timer, &QTimer::timeout, timer, &QTimer::deleteLater); std::chrono::milliseconds msec = std::chrono::duration_cast(duration); timer->start(msec.count());