2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2012-11-05 16:42:31 +01:00
|
|
|
|
|
|
|
|
#include "debugoutputcommand.h"
|
|
|
|
|
|
2013-07-16 17:00:07 +02:00
|
|
|
#include <QtDebug>
|
|
|
|
|
|
2012-11-05 16:42:31 +01:00
|
|
|
namespace QmlDesigner {
|
|
|
|
|
|
2018-07-24 23:56:45 +02:00
|
|
|
DebugOutputCommand::DebugOutputCommand() = default;
|
2012-11-05 16:42:31 +01:00
|
|
|
|
2015-02-18 13:32:35 +01:00
|
|
|
DebugOutputCommand::DebugOutputCommand(const QString &text, DebugOutputCommand::Type type, const QVector<qint32> &instanceIds)
|
|
|
|
|
: m_instanceIds(instanceIds)
|
|
|
|
|
, m_text(text)
|
|
|
|
|
, m_type(type)
|
2012-11-05 16:42:31 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
qint32 DebugOutputCommand::type() const
|
|
|
|
|
{
|
|
|
|
|
return m_type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString DebugOutputCommand::text() const
|
|
|
|
|
{
|
|
|
|
|
return m_text;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-18 13:32:35 +01:00
|
|
|
QVector<qint32> DebugOutputCommand::instanceIds() const
|
|
|
|
|
{
|
|
|
|
|
return m_instanceIds;
|
|
|
|
|
}
|
|
|
|
|
|
2012-11-05 16:42:31 +01:00
|
|
|
QDataStream &operator<<(QDataStream &out, const DebugOutputCommand &command)
|
|
|
|
|
{
|
|
|
|
|
out << command.type();
|
|
|
|
|
out << command.text();
|
2015-02-18 13:32:35 +01:00
|
|
|
out << command.instanceIds();
|
2012-11-05 16:42:31 +01:00
|
|
|
|
|
|
|
|
return out;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QDataStream &operator>>(QDataStream &in, DebugOutputCommand &command)
|
|
|
|
|
{
|
|
|
|
|
in >> command.m_type;
|
|
|
|
|
in >> command.m_text;
|
2015-02-18 13:32:35 +01:00
|
|
|
in >> command.m_instanceIds;
|
2012-11-05 16:42:31 +01:00
|
|
|
|
|
|
|
|
return in;
|
|
|
|
|
}
|
|
|
|
|
|
2013-07-04 17:06:31 +02:00
|
|
|
bool operator ==(const DebugOutputCommand &first, const DebugOutputCommand &second)
|
|
|
|
|
{
|
|
|
|
|
return first.m_type == second.m_type
|
2013-11-13 13:27:59 +01:00
|
|
|
&& first.m_text == second.m_text;
|
2013-07-04 17:06:31 +02:00
|
|
|
}
|
|
|
|
|
|
2013-07-16 17:00:07 +02:00
|
|
|
QDebug operator <<(QDebug debug, const DebugOutputCommand &command)
|
|
|
|
|
{
|
|
|
|
|
return debug.nospace() << "DebugOutputCommand("
|
|
|
|
|
<< "type: " << command.type() << ", "
|
|
|
|
|
<< "text: " << command.text() << ")";
|
|
|
|
|
}
|
|
|
|
|
|
2012-11-05 16:42:31 +01:00
|
|
|
} // namespace QmlDesigner
|