Commit 1f8ba004 authored by Albert Astals Cid's avatar Albert Astals Cid

Use default NetworkPacket copy constuctor and assignment operator

clazy was complaining that the class had copy constructor but no assignment operator, which is usually suspicious

This is a bit of behaviour change though, since now m_payloadTransferInfo is also copied, which before wasn't, not sure if this is actually a good or a bad thing
parent 8d939e13
......@@ -55,15 +55,6 @@ NetworkPacket::NetworkPacket(const QString& type, const QVariantMap& body)
{
}
NetworkPacket::NetworkPacket(const NetworkPacket& other)
: m_id(other.m_id)
, m_type(other.m_type)
, m_body(QVariantMap(other.m_body))
, m_payload(other.m_payload)
, m_payloadSize(other.m_payloadSize)
{
}
void NetworkPacket::createIdentityPacket(NetworkPacket* np)
{
KdeConnectConfig* config = KdeConnectConfig::instance();
......
......@@ -48,7 +48,8 @@ public:
const static int s_protocolVersion;
explicit NetworkPacket(const QString& type = QStringLiteral("empty"), const QVariantMap& body = {});
NetworkPacket(const NetworkPacket& other); // Copy constructor, required for QMetaType and queued signals
NetworkPacket(const NetworkPacket& other) = default; // Copy constructor, required for QMetaType and queued signals
NetworkPacket &operator=(const NetworkPacket& other) = default;
static void createIdentityPacket(NetworkPacket*);
......@@ -88,7 +89,7 @@ private:
QString m_id;
QString m_type;
QVariantMap m_body;
QSharedPointer<QIODevice> m_payload;
qint64 m_payloadSize;
QVariantMap m_payloadTransferInfo;
......
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