From cca9a575e64e2824d36680d67de84c5cb1653165 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Thu, 14 Dec 2017 19:38:19 +0900 Subject: Declare SyncRoomData as C++-movable This fixes compilation with older compilers that try to instantiate a copy constructor (and fail because unique_ptr) but actually is more proper in general. Also: do not advertise the class as Q_MOVABLE_TYPE: this was useful for QList/QVector when SyncRoomData was copyable; now it isn't, and Qt containers can't deal with non-copyable classes at all. --- jobs/syncjob.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'jobs/syncjob.h') diff --git a/jobs/syncjob.h b/jobs/syncjob.h index e9288486..aed36e0b 100644 --- a/jobs/syncjob.h +++ b/jobs/syncjob.h @@ -58,12 +58,9 @@ namespace QMatrixClient SyncRoomData(const QString& roomId, JoinState joinState_, const QJsonObject& room_); + SyncRoomData(SyncRoomData&&) = default; + SyncRoomData& operator=(SyncRoomData&&) = default; }; -} // namespace QMatrixClient -Q_DECLARE_TYPEINFO(QMatrixClient::SyncRoomData, Q_MOVABLE_TYPE); - -namespace QMatrixClient -{ // QVector cannot work with non-copiable objects, std::vector can. using SyncDataList = std::vector; -- cgit v1.2.3