Commit 90ce3aec authored by Marco Bubke's avatar Marco Bubke
Browse files

QmlDesigner: Test mode for qml puppet streams



Change-Id: I93128c60892900d6b4728569b84efb0ed835b51f
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent 6312cc18
......@@ -58,6 +58,12 @@ QVector<InformationContainer> ChildrenChangedCommand::informations() const
return m_informationVector;
}
void ChildrenChangedCommand::sort()
{
qSort(m_childrenVector);
qSort(m_informationVector);
}
QDataStream &operator<<(QDataStream &out, const ChildrenChangedCommand &command)
{
out << command.parentInstanceId();
......@@ -75,4 +81,11 @@ QDataStream &operator>>(QDataStream &in, ChildrenChangedCommand &command)
return in;
}
bool operator ==(const ChildrenChangedCommand &first, const ChildrenChangedCommand &second)
{
return first.m_parentInstanceId == second.m_parentInstanceId
&& first.m_childrenVector == second.m_childrenVector
&& first.m_informationVector == second.m_informationVector;
}
} // namespace QmlDesigner
......@@ -39,6 +39,8 @@ namespace QmlDesigner {
class ChildrenChangedCommand
{
friend QDataStream &operator>>(QDataStream &in, ChildrenChangedCommand &command);
friend bool operator ==(const ChildrenChangedCommand &first, const ChildrenChangedCommand &second);
public:
ChildrenChangedCommand();
explicit ChildrenChangedCommand(qint32 parentInstanceId, const QVector<qint32> &childrenInstancesconst, const QVector<InformationContainer> &informationVector);
......@@ -47,6 +49,8 @@ public:
qint32 parentInstanceId() const;
QVector<InformationContainer> informations() const;
void sort();
private:
qint32 m_parentInstanceId;
QVector<qint32> m_childrenVector;
......@@ -56,6 +60,8 @@ private:
QDataStream &operator<<(QDataStream &out, const ChildrenChangedCommand &command);
QDataStream &operator>>(QDataStream &in, ChildrenChangedCommand &command);
bool operator ==(const ChildrenChangedCommand &first, const ChildrenChangedCommand &second);
} // namespace QmlDesigner
Q_DECLARE_METATYPE(QmlDesigner::ChildrenChangedCommand)
......
......@@ -47,6 +47,11 @@ QVector<qint32> ComponentCompletedCommand::instances() const
return m_instanceVector;
}
void ComponentCompletedCommand::sort()
{
qSort(m_instanceVector);
}
QDataStream &operator<<(QDataStream &out, const ComponentCompletedCommand &command)
{
out << command.instances();
......@@ -61,5 +66,10 @@ QDataStream &operator>>(QDataStream &in, ComponentCompletedCommand &command)
return in;
}
bool operator ==(const ComponentCompletedCommand &first, const ComponentCompletedCommand &second)
{
return first.m_instanceVector == second.m_instanceVector;
}
} // namespace QmlDesigner
......@@ -38,6 +38,7 @@ namespace QmlDesigner {
class ComponentCompletedCommand
{
friend QDataStream &operator>>(QDataStream &in, ComponentCompletedCommand &command);
friend bool operator ==(const ComponentCompletedCommand &first, const ComponentCompletedCommand &second);
public:
ComponentCompletedCommand();
......@@ -45,6 +46,8 @@ public:
QVector<qint32> instances() const;
void sort();
private:
QVector<qint32> m_instanceVector;
};
......@@ -52,6 +55,8 @@ private:
QDataStream &operator<<(QDataStream &out, const ComponentCompletedCommand &command);
QDataStream &operator>>(QDataStream &in, ComponentCompletedCommand &command);
bool operator ==(const ComponentCompletedCommand &first, const ComponentCompletedCommand &second);
} // namespace QmlDesigner
Q_DECLARE_METATYPE(QmlDesigner::ComponentCompletedCommand)
......
......@@ -68,4 +68,10 @@ QDataStream &operator>>(QDataStream &in, DebugOutputCommand &command)
return in;
}
bool operator ==(const DebugOutputCommand &first, const DebugOutputCommand &second)
{
return first.m_type == second.m_type
&& second.m_text == second.m_text;
}
} // namespace QmlDesigner
......@@ -39,6 +39,7 @@ namespace QmlDesigner {
class DebugOutputCommand
{
friend QDataStream &operator>>(QDataStream &in, DebugOutputCommand &command);
friend bool operator ==(const DebugOutputCommand &first, const DebugOutputCommand &second);
public:
enum Type {
......@@ -62,6 +63,8 @@ private:
QDataStream &operator<<(QDataStream &out, const DebugOutputCommand &command);
QDataStream &operator>>(QDataStream &in, DebugOutputCommand &command);
bool operator ==(const DebugOutputCommand &first, const DebugOutputCommand &second);
} // namespace QmlDesigner
Q_DECLARE_METATYPE(QmlDesigner::DebugOutputCommand)
......
......@@ -49,6 +49,11 @@ QVector<InformationContainer> InformationChangedCommand::informations() const
return m_informationVector;
}
void InformationChangedCommand::sort()
{
qSort(m_informationVector);
}
QDataStream &operator<<(QDataStream &out, const InformationChangedCommand &command)
{
out << command.informations();
......@@ -63,4 +68,9 @@ QDataStream &operator>>(QDataStream &in, InformationChangedCommand &command)
return in;
}
bool operator ==(const InformationChangedCommand &first, const InformationChangedCommand &second)
{
return first.m_informationVector == second.m_informationVector;
}
} // namespace QmlDesigner
......@@ -41,6 +41,7 @@ namespace QmlDesigner {
class InformationChangedCommand
{
friend QDataStream &operator>>(QDataStream &in, InformationChangedCommand &command);
friend bool operator ==(const InformationChangedCommand &first, const InformationChangedCommand &second);
public:
InformationChangedCommand();
......@@ -48,6 +49,8 @@ public:
QVector<InformationContainer> informations() const;
void sort();
private:
QVector<InformationContainer> m_informationVector;
};
......@@ -55,6 +58,8 @@ private:
QDataStream &operator<<(QDataStream &out, const InformationChangedCommand &command);
QDataStream &operator>>(QDataStream &in, InformationChangedCommand &command);
bool operator ==(const InformationChangedCommand &first, const InformationChangedCommand &second);
} // namespace QmlDesigner
Q_DECLARE_METATYPE(QmlDesigner::InformationChangedCommand)
......
......@@ -49,6 +49,11 @@ QVector<ImageContainer> PixmapChangedCommand::images() const
return m_imageVector;
}
void PixmapChangedCommand::sort()
{
qSort(m_imageVector);
}
QDataStream &operator<<(QDataStream &out, const PixmapChangedCommand &command)
{
out << command.images();
......@@ -63,4 +68,9 @@ QDataStream &operator>>(QDataStream &in, PixmapChangedCommand &command)
return in;
}
bool operator ==(const PixmapChangedCommand &first, const PixmapChangedCommand &second)
{
return first.m_imageVector == second.m_imageVector;
}
} // namespace QmlDesigner
......@@ -38,12 +38,16 @@ namespace QmlDesigner {
class PixmapChangedCommand
{
friend QDataStream &operator>>(QDataStream &in, PixmapChangedCommand &command);
friend bool operator ==(const PixmapChangedCommand &first, const PixmapChangedCommand &second);
public:
PixmapChangedCommand();
explicit PixmapChangedCommand(const QVector<ImageContainer> &imageVector);
QVector<ImageContainer> images() const;
void sort();
private:
QVector<ImageContainer> m_imageVector;
};
......@@ -51,6 +55,8 @@ private:
QDataStream &operator<<(QDataStream &out, const PixmapChangedCommand &command);
QDataStream &operator>>(QDataStream &in, PixmapChangedCommand &command);
bool operator ==(const PixmapChangedCommand &first, const PixmapChangedCommand &second);
} // namespace QmlDesigner
Q_DECLARE_METATYPE(QmlDesigner::PixmapChangedCommand)
......
......@@ -45,6 +45,11 @@ QVector<ImageContainer> StatePreviewImageChangedCommand::previews()const
return m_previewVector;
}
void StatePreviewImageChangedCommand::sort()
{
qSort(m_previewVector);
}
QDataStream &operator<<(QDataStream &out, const StatePreviewImageChangedCommand &command)
{
out << command.previews();
......@@ -58,4 +63,10 @@ QDataStream &operator>>(QDataStream &in, StatePreviewImageChangedCommand &comman
return in;
}
bool operator ==(const StatePreviewImageChangedCommand &first, const StatePreviewImageChangedCommand &second)
{
return first.m_previewVector == second.m_previewVector;
}
} // namespace QmlDesigner
......@@ -39,12 +39,16 @@ namespace QmlDesigner {
class StatePreviewImageChangedCommand
{
friend QDataStream &operator>>(QDataStream &in, StatePreviewImageChangedCommand &command);
friend bool operator ==(const StatePreviewImageChangedCommand &first, const StatePreviewImageChangedCommand &second);
public:
StatePreviewImageChangedCommand();
explicit StatePreviewImageChangedCommand(const QVector<ImageContainer> &imageVector);
QVector<ImageContainer> previews() const;
void sort();
private:
QVector<ImageContainer> m_previewVector;
};
......@@ -52,6 +56,8 @@ private:
QDataStream &operator<<(QDataStream &out, const StatePreviewImageChangedCommand &command);
QDataStream &operator>>(QDataStream &in, StatePreviewImageChangedCommand &command);
bool operator ==(const StatePreviewImageChangedCommand &first, const StatePreviewImageChangedCommand &second);
} // namespace QmlDesigner
Q_DECLARE_METATYPE(QmlDesigner::StatePreviewImageChangedCommand)
......
......@@ -61,5 +61,9 @@ QDataStream &operator>>(QDataStream &in, SynchronizeCommand &command)
return in;
}
bool operator ==(const SynchronizeCommand &first, const SynchronizeCommand &second)
{
return first.m_synchronizeId == second.m_synchronizeId;
}
} // namespace QmlDesigner
......@@ -40,6 +40,7 @@ namespace QmlDesigner {
class SynchronizeCommand
{
friend QDataStream &operator>>(QDataStream &in, SynchronizeCommand &command);
friend bool operator ==(const SynchronizeCommand &first, const SynchronizeCommand &second);
public:
SynchronizeCommand();
......@@ -54,6 +55,8 @@ private:
QDataStream &operator<<(QDataStream &out, const SynchronizeCommand &command);
QDataStream &operator>>(QDataStream &in, SynchronizeCommand &command);
bool operator ==(const SynchronizeCommand &first, const SynchronizeCommand &second);
} // namespace QmlDesigner
Q_DECLARE_METATYPE(QmlDesigner::SynchronizeCommand)
......
......@@ -60,6 +60,11 @@ QVector<qint32> TokenCommand::instances() const
return m_instanceIdVector;
}
void TokenCommand::sort()
{
qSort(m_instanceIdVector);
}
QDataStream &operator<<(QDataStream &out, const TokenCommand &command)
{
out << command.tokenName();
......@@ -77,5 +82,11 @@ QDataStream &operator>>(QDataStream &in, TokenCommand &command)
return in;
}
bool operator ==(const TokenCommand &first, const TokenCommand &second)
{
return first.m_tokenNumber == second.m_tokenNumber
&& first.m_tokenNumber == second.m_tokenNumber
&& first.m_instanceIdVector == second.m_instanceIdVector;
}
} // namespace QmlDesigner
......@@ -41,6 +41,7 @@ namespace QmlDesigner {
class TokenCommand
{
friend QDataStream &operator>>(QDataStream &in, TokenCommand &command);
friend bool operator ==(const TokenCommand &first, const TokenCommand &second);
public:
TokenCommand();
......@@ -50,6 +51,8 @@ public:
qint32 tokenNumber() const;
QVector<qint32> instances() const;
void sort();
private:
QString m_tokenName;
qint32 m_tokenNumber;
......@@ -59,6 +62,8 @@ private:
QDataStream &operator<<(QDataStream &out, const TokenCommand &command);
QDataStream &operator>>(QDataStream &in, TokenCommand &command);
bool operator ==(const TokenCommand &first, const TokenCommand &second);
} // namespace QmlDesigner
Q_DECLARE_METATYPE(QmlDesigner::TokenCommand)
......
......@@ -67,6 +67,11 @@ void ValuesChangedCommand::removeSharedMemorys(const QVector<qint32> &keyNumberV
}
}
void ValuesChangedCommand::sort()
{
qSort(m_valueChangeVector);
}
static const QLatin1String valueKeyTemplateString("Values-%1");
static QSharedMemory *createSharedMemory(qint32 key, int byteCount)
......@@ -142,4 +147,9 @@ QDataStream &operator>>(QDataStream &in, ValuesChangedCommand &command)
return in;
}
bool operator ==(const ValuesChangedCommand &first, const ValuesChangedCommand &second)
{
return first.m_valueChangeVector == second.m_valueChangeVector;
}
} // namespace QmlDesigner
......@@ -41,6 +41,7 @@ class ValuesChangedCommand
{
friend QDataStream &operator<<(QDataStream &out, const ValuesChangedCommand &command);
friend QDataStream &operator>>(QDataStream &in, ValuesChangedCommand &command);
friend bool operator ==(const ValuesChangedCommand &first, const ValuesChangedCommand &second);
public:
ValuesChangedCommand();
......@@ -51,6 +52,8 @@ public:
static void removeSharedMemorys(const QVector<qint32> &keyNumberVector);
void sort();
private:
QVector<PropertyValueContainer> m_valueChangeVector;
mutable quint32 m_keyNumber;
......@@ -59,6 +62,8 @@ private:
QDataStream &operator<<(QDataStream &out, const ValuesChangedCommand &command);
QDataStream &operator>>(QDataStream &in, ValuesChangedCommand &command);
bool operator ==(const ValuesChangedCommand &first, const ValuesChangedCommand &second);
} // namespace QmlDesigner
Q_DECLARE_METATYPE(QmlDesigner::ValuesChangedCommand)
......
......@@ -231,4 +231,15 @@ QDataStream &operator>>(QDataStream &in, ImageContainer &container)
return in;
}
bool operator ==(const ImageContainer &first, const ImageContainer &second)
{
return first.m_instanceId == second.m_instanceId
&& first.m_image == second.m_image;
}
bool operator <(const ImageContainer &first, const ImageContainer &second)
{
return first.m_instanceId < second.m_instanceId;
}
} // namespace QmlDesigner
......@@ -38,6 +38,9 @@ namespace QmlDesigner {
class ImageContainer
{
friend QDataStream &operator>>(QDataStream &in, ImageContainer &container);
friend bool operator ==(const ImageContainer &first, const ImageContainer &second);
friend bool operator <(const ImageContainer &first, const ImageContainer &second);
public:
ImageContainer();
ImageContainer(qint32 instanceId, const QImage &image, qint32 keyNumber);
......@@ -59,6 +62,9 @@ private:
QDataStream &operator<<(QDataStream &out, const ImageContainer &container);
QDataStream &operator>>(QDataStream &in, ImageContainer &container);
bool operator ==(const ImageContainer &first, const ImageContainer &second);
bool operator <(const ImageContainer &first, const ImageContainer &second);
} // namespace QmlDesigner
Q_DECLARE_METATYPE(QmlDesigner::ImageContainer)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment