diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2022-04-13 18:15:29 +0200 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2022-04-13 20:44:23 +0200 |
commit | 6cf4dc7f64b42cbbff6a2ce7616ee625a87a29f5 (patch) | |
tree | ba3d80b44f208854fda6346403e06b186a4b8dec /src | |
parent | f60a63cc5f16b738d9d2ada3f10b27cf999df323 (diff) | |
download | bitcoin-6cf4dc7f64b42cbbff6a2ce7616ee625a87a29f5.tar.xz |
qt: Do not assume `qDBusRegisterMetaType` return type
`qDBusRegisterMetaType` returns:
- `int` in Qt 5
- `QMetaType` in Qt 6
Diffstat (limited to 'src')
-rw-r--r-- | src/qt/notificator.cpp | 12 |
1 files 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 <QTemporaryFile> #include <QVariant> #ifdef USE_DBUS -#include <stdint.h> +#include <QDBusMetaType> #include <QtDBus> +#include <stdint.h> #endif #ifdef Q_OS_MAC #include <qt/macnotificationhandler.h> @@ -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<FreedesktopImage>(); -} - QVariant FreedesktopImage::toVariant(const QImage &img) { FreedesktopImage fimg(img); - return QVariant(FreedesktopImage::metaType(), &fimg); + return QVariant(qDBusRegisterMetaType<FreedesktopImage>(), &fimg); } void Notificator::notifyDBus(Class cls, const QString &title, const QString &text, const QIcon &icon, int millisTimeout) |