From 6cf4dc7f64b42cbbff6a2ce7616ee625a87a29f5 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Wed, 13 Apr 2022 18:15:29 +0200 Subject: [PATCH] qt: Do not assume `qDBusRegisterMetaType` return type `qDBusRegisterMetaType` returns: - `int` in Qt 5 - `QMetaType` in Qt 6 --- src/qt/notificator.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/qt/notificator.cpp b/src/qt/notificator.cpp index b097ef080c..51151b0be8 100644 --- a/src/qt/notificator.cpp +++ b/src/qt/notificator.cpp @@ -14,8 +14,9 @@ #include #include #ifdef USE_DBUS -#include +#include #include +#include #endif #ifdef Q_OS_MAC #include @@ -73,8 +74,6 @@ public: FreedesktopImage() {} explicit FreedesktopImage(const QImage &img); - static int metaType(); - // Image to variant that can be marshalled over DBus static QVariant toVariant(const QImage &img); @@ -136,15 +135,10 @@ const QDBusArgument &operator>>(const QDBusArgument &a, FreedesktopImage &i) return a; } -int FreedesktopImage::metaType() -{ - return qDBusRegisterMetaType(); -} - QVariant FreedesktopImage::toVariant(const QImage &img) { FreedesktopImage fimg(img); - return QVariant(FreedesktopImage::metaType(), &fimg); + return QVariant(qDBusRegisterMetaType(), &fimg); } void Notificator::notifyDBus(Class cls, const QString &title, const QString &text, const QIcon &icon, int millisTimeout)