18#include <QtDBus/QDBusArgument>
19#include <QtDBus/QDBusConnection>
20#include <QtDBus/QDBusMessage>
21#include <QtDBus/QDBusPendingCall>
22#include <QtDBus/QDBusPendingCallWatcher>
23#include <QtDBus/QDBusPendingReply>
24#include <QtDBus/QDBusVariant>
25#include <QtDBus/QtDBus>
56 qRegisterMetaType<QDBusVariant>();
57 qDBusRegisterMetaType<QMap<QString, QVariantMap>>();
62 qCDebug(lcQGtk3PortalInterface) <<
"QGtk3PortalInterface instantiated without QGtk3Storage."
63 <<
"No reaction to runtime theme changes.";
72void QGtk3PortalInterface::queryColorScheme() {
75 "org.freedesktop.portal.Desktop"_L1,
76 "/org/freedesktop/portal/desktop"_L1,
77 "org.freedesktop.portal.Settings"_L1,
"ReadAll"_L1);
85 QDBusPendingReply<QMap<QString, QVariantMap>>
reply = *
watcher;
86 if (
reply.isValid()) {
87 QMap<QString, QVariantMap> settings = reply.value();
88 if (!settings.isEmpty()) {
89 settingChanged(appearanceInterface, colorSchemeKey,
90 QDBusVariant(settings.value(appearanceInterface).value(colorSchemeKey)));
93 qCDebug(lcQGtk3PortalInterface) <<
"Failed to query org.freedesktop.portal.Settings: "
100 "org.freedesktop.portal.Desktop"_L1,
"/org/freedesktop/portal/desktop"_L1,
101 "org.freedesktop.portal.Settings"_L1,
"SettingChanged"_L1,
this,
113 if (m_colorScheme != newColorScheme) {
114 m_colorScheme = newColorScheme;
123#include "moc_qgtk3portalinterface_p.cpp"
void beginMapEntry()
Opens a D-Bus map entry suitable for appending the key and value entries.
void endMapEntry()
Closes a D-Bus map entry opened with beginMapEntry().
void endMap()
Closes a D-Bus map opened with beginMap().
bool atEnd() const
Returns true if there are no more elements to be extracted from this QDBusArgument.
void beginMap(int keyMetaTypeId, int valueMetaTypeId)
static QDBusConnection sessionBus()
Returns a QDBusConnection object opened with the session bus.
static QDBusMessage createMethodCall(const QString &destination, const QString &path, const QString &interface, const QString &method)
Constructs a new DBus message representing a method call.
void finished(QDBusPendingCallWatcher *self=nullptr)
This signal is emitted when the pending call has finished and its reply is available.
Qt::ColorScheme colorScheme() const
QGtk3PortalInterface(QGtk3Storage *s)
void handleThemeChange()
Handles a theme change at runtime.
iterator insert(const Key &key, const T &value)
NetworkError error() const
Returns the error that was found during the processing of this request.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
\macro QT_RESTRICTED_CAST_FROM_ASCII
QMap< QString, QString > map
[6]
Combined button and popup list for selecting options.
DBusConnection * connection
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static QGtk3Storage * m_storage
const QDBusArgument & operator>>(const QDBusArgument &argument, QMap< QString, QVariantMap > &map)
static constexpr QLatin1StringView colorSchemeKey("color-scheme")
static constexpr QLatin1StringView appearanceInterface("org.freedesktop.appearance")
#define Q_LOGGING_CATEGORY(name,...)
#define qCDebug(category,...)
GLuint GLsizei const GLchar * message
QFutureWatcher< int > watcher