Skip to content

Commit 254f3cc

Browse files
committed
Merge #584: Getting ready to Qt 6 (5/n). Do not assume qDBusRegisterMetaType return type
6cf4dc7 qt: Do not assume `qDBusRegisterMetaType` return type (Hennadii Stepanov) Pull request description: `qDBusRegisterMetaType` returns: - [`int`](https://doc.qt.io/qt-5/qdbusargument.html#qDBusRegisterMetaType) in Qt 5 - [`QMetaType`](https://doc.qt.io/qt-6/qdbusargument.html#qDBusRegisterMetaType) in Qt 6 ACKs for top commit: laanwj: Anyhow code review ACK 6cf4dc7 w0xlt: tACK 6cf4dc7 on Ubuntu 21.10, Qt 5.15.2. Tree-SHA512: 17d43e191d31a6f927d19550c52471ed3b9222f492a23cee2e553f2c679cf37125e00637b00ea9f4ee3e37dfcf5278171be9a5e1e2e899592516291c7b5cd942
2 parents 37e49cc + 6cf4dc7 commit 254f3cc

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/qt/notificator.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
#include <QTemporaryFile>
1515
#include <QVariant>
1616
#ifdef USE_DBUS
17-
#include <stdint.h>
17+
#include <QDBusMetaType>
1818
#include <QtDBus>
19+
#include <stdint.h>
1920
#endif
2021
#ifdef Q_OS_MAC
2122
#include <qt/macnotificationhandler.h>
@@ -73,8 +74,6 @@ class FreedesktopImage
7374
FreedesktopImage() {}
7475
explicit FreedesktopImage(const QImage &img);
7576

76-
static int metaType();
77-
7877
// Image to variant that can be marshalled over DBus
7978
static QVariant toVariant(const QImage &img);
8079

@@ -136,15 +135,10 @@ const QDBusArgument &operator>>(const QDBusArgument &a, FreedesktopImage &i)
136135
return a;
137136
}
138137

139-
int FreedesktopImage::metaType()
140-
{
141-
return qDBusRegisterMetaType<FreedesktopImage>();
142-
}
143-
144138
QVariant FreedesktopImage::toVariant(const QImage &img)
145139
{
146140
FreedesktopImage fimg(img);
147-
return QVariant(FreedesktopImage::metaType(), &fimg);
141+
return QVariant(qDBusRegisterMetaType<FreedesktopImage>(), &fimg);
148142
}
149143

150144
void Notificator::notifyDBus(Class cls, const QString &title, const QString &text, const QIcon &icon, int millisTimeout)

0 commit comments

Comments
 (0)