diff options
author | Marc Mutz <marc.mutz@qt.io> | 2023-05-02 09:30:00 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2023-05-02 14:51:01 +0200 |
commit | 426b5fbce437128a10055ebfdc4431e6a2ab312c (patch) | |
tree | 3d4f8a31a754db58033fcdbaa0960c5be6e539f4 /src/dbus/qdbusinternalfilters.cpp | |
parent | 1bf8c1e23dcb4246b35ef1983a0bc5542410347a (diff) |
D-Bus: use move() on QVariants in writeProperty()
The writeProperty() function takes the QVariant value by value, so we
can move from it, using the newly-added QMetaProperty::write() rvalue
overload.
As a drive-by, replace a copy-assignment with a move.
Task-number: QTBUG-112762
Change-Id: I6d5361830b4874fa846be513882ede4ab881246b
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/dbus/qdbusinternalfilters.cpp')
-rw-r--r-- | src/dbus/qdbusinternalfilters.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dbus/qdbusinternalfilters.cpp b/src/dbus/qdbusinternalfilters.cpp index d963903dc6..57ae0326e7 100644 --- a/src/dbus/qdbusinternalfilters.cpp +++ b/src/dbus/qdbusinternalfilters.cpp @@ -332,14 +332,14 @@ static int writeProperty(QObject *obj, const QByteArray &property_name, QVariant return PropertyWriteFailed; } - value = other; + value = std::move(other); } if (mp.metaType() == QMetaType::fromType<QDBusVariant>()) value = QVariant::fromValue(QDBusVariant(value)); // the property type here should match - return mp.write(obj, value) ? PropertyWriteSuccess : PropertyWriteFailed; + return mp.write(obj, std::move(value)) ? PropertyWriteSuccess : PropertyWriteFailed; } QDBusMessage qDBusPropertySet(const QDBusConnectionPrivate::ObjectTreeNode &node, |