summaryrefslogtreecommitdiff
path: root/share/qtcreator/qml/qmlpuppet/commands
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@qt.io>2022-09-15 11:33:28 +0200
committerTim Jenssen <tim.jenssen@qt.io>2022-09-22 19:06:21 +0000
commit4bb4e07ad8419ba4edc1d9cb543ab8a0ddb1d07d (patch)
treebac1c69ab091a2f755f666cbd7461b134b710588 /share/qtcreator/qml/qmlpuppet/commands
parent1518a74dffe05fcba02d541509b668bac252c764 (diff)
downloadqt-creator-4bb4e07ad8419ba4edc1d9cb543ab8a0ddb1d07d.tar.gz
QmlDesigner: Inline SynchronizeCommand
Change-Id: Id030fb6aba7f1ba61ce97ebebb5e91a809ab6d8d Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Marco Bubke <marco.bubke@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'share/qtcreator/qml/qmlpuppet/commands')
-rw-r--r--share/qtcreator/qml/qmlpuppet/commands/commands.pri2
-rw-r--r--share/qtcreator/qml/qmlpuppet/commands/synchronizecommand.cpp50
-rw-r--r--share/qtcreator/qml/qmlpuppet/commands/synchronizecommand.h44
3 files changed, 34 insertions, 62 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/commands/commands.pri b/share/qtcreator/qml/qmlpuppet/commands/commands.pri
index f63b9486f6..0fb8e0132c 100644
--- a/share/qtcreator/qml/qmlpuppet/commands/commands.pri
+++ b/share/qtcreator/qml/qmlpuppet/commands/commands.pri
@@ -38,7 +38,7 @@ HEADERS += $$PWD/synchronizecommand.h \ \
$$PWD/view3dactioncommand.h \
$$PWD/requestmodelnodepreviewimagecommand.h
-SOURCES += $$PWD/synchronizecommand.cpp \
+SOURCES += \
$$PWD/changepreviewimagesizecommand.cpp \
$$PWD/changelanguagecommand.cpp \
$$PWD/debugoutputcommand.cpp \
diff --git a/share/qtcreator/qml/qmlpuppet/commands/synchronizecommand.cpp b/share/qtcreator/qml/qmlpuppet/commands/synchronizecommand.cpp
deleted file mode 100644
index 7cc2a7edcb..0000000000
--- a/share/qtcreator/qml/qmlpuppet/commands/synchronizecommand.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0
-
-#include "synchronizecommand.h"
-
-#include <QDebug>
-
-namespace QmlDesigner {
-
-SynchronizeCommand::SynchronizeCommand()
- : m_synchronizeId(-1)
-{
-}
-
-SynchronizeCommand::SynchronizeCommand(int synchronizeId)
- : m_synchronizeId (synchronizeId)
-{
-}
-
-int SynchronizeCommand::synchronizeId() const
-{
- return m_synchronizeId;
-}
-
-
-QDataStream &operator<<(QDataStream &out, const SynchronizeCommand &command)
-{
- out << command.synchronizeId();
-
- return out;
-}
-
-QDataStream &operator>>(QDataStream &in, SynchronizeCommand &command)
-{
- in >> command.m_synchronizeId;
-
- return in;
-}
-
-bool operator ==(const SynchronizeCommand &first, const SynchronizeCommand &second)
-{
- return first.m_synchronizeId == second.m_synchronizeId;
-}
-
-QDebug operator <<(QDebug debug, const SynchronizeCommand &command)
-{
- return debug.nospace() << "SynchronizeCommand(synchronizeId: " << command.synchronizeId() << ")";
-}
-
-} // namespace QmlDesigner
diff --git a/share/qtcreator/qml/qmlpuppet/commands/synchronizecommand.h b/share/qtcreator/qml/qmlpuppet/commands/synchronizecommand.h
index 7f5d0a0b48..a881d8077c 100644
--- a/share/qtcreator/qml/qmlpuppet/commands/synchronizecommand.h
+++ b/share/qtcreator/qml/qmlpuppet/commands/synchronizecommand.h
@@ -3,11 +3,10 @@
#pragma once
+#include <QDebug>
#include <QMetaType>
#include <QVector>
-#include "propertyvaluecontainer.h"
-
namespace QmlDesigner {
class SynchronizeCommand
@@ -16,21 +15,44 @@ class SynchronizeCommand
friend bool operator ==(const SynchronizeCommand &first, const SynchronizeCommand &second);
public:
- SynchronizeCommand();
- explicit SynchronizeCommand(int synchronizeId);
+ SynchronizeCommand()
+ : m_synchronizeId(-1)
+ {}
+ explicit SynchronizeCommand(int synchronizeId)
+ : m_synchronizeId(synchronizeId)
+ {}
+
+ int synchronizeId() const { return m_synchronizeId; }
+
+ friend QDataStream &operator<<(QDataStream &out, const SynchronizeCommand &command)
+ {
+ out << command.synchronizeId();
+
+ return out;
+ }
+
+ friend QDataStream &operator>>(QDataStream &in, SynchronizeCommand &command)
+ {
+ in >> command.m_synchronizeId;
- int synchronizeId() const;
+ return in;
+ }
+
+ friend bool operator==(const SynchronizeCommand &first, const SynchronizeCommand &second)
+ {
+ return first.m_synchronizeId == second.m_synchronizeId;
+ }
+
+ friend QDebug operator<<(QDebug debug, const SynchronizeCommand &command)
+ {
+ return debug.nospace() << "SynchronizeCommand(synchronizeId: " << command.synchronizeId()
+ << ")";
+ }
private:
int m_synchronizeId;
};
-QDataStream &operator<<(QDataStream &out, const SynchronizeCommand &command);
-QDataStream &operator>>(QDataStream &in, SynchronizeCommand &command);
-
-bool operator ==(const SynchronizeCommand &first, const SynchronizeCommand &second);
-QDebug operator <<(QDebug debug, const SynchronizeCommand &command);
-
} // namespace QmlDesigner
Q_DECLARE_METATYPE(QmlDesigner::SynchronizeCommand)