/***************************************************************************
- * Copyright (C) 2005-2016 by the Quassel Project *
+ * Copyright (C) 2005-2018 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#ifndef NETWORKEVENT_H
-#define NETWORKEVENT_H
+#pragma once
#include <QStringList>
#include <QVariantList>
+#include <utility>
#include "event.h"
#include "network.h"
-class NetworkEvent : public Event
+class COMMON_EXPORT NetworkEvent : public Event
{
public:
explicit NetworkEvent(EventManager::EventType type, Network *network)
protected:
explicit NetworkEvent(EventManager::EventType type, QVariantMap &map, Network *network);
- void toVariantMap(QVariantMap &map) const;
+ void toVariantMap(QVariantMap &map) const override;
- virtual inline QString className() const { return "NetworkEvent"; }
- virtual inline void debugInfo(QDebug &dbg) const { dbg.nospace() << ", net = " << qPrintable(_network->networkName()); }
+ inline QString className() const override { return "NetworkEvent"; }
+ inline void debugInfo(QDebug &dbg) const override { dbg.nospace() << ", net = " << qPrintable(_network->networkName()); }
private:
Network *_network;
/*****************************************************************************/
-class NetworkConnectionEvent : public NetworkEvent
+class COMMON_EXPORT NetworkConnectionEvent : public NetworkEvent
{
public:
explicit NetworkConnectionEvent(EventManager::EventType type, Network *network, Network::ConnectionState state)
protected:
explicit NetworkConnectionEvent(EventManager::EventType type, QVariantMap &map, Network *network);
- void toVariantMap(QVariantMap &map) const;
+ void toVariantMap(QVariantMap &map) const override;
- virtual inline QString className() const { return "NetworkConnectionEvent"; }
- virtual inline void debugInfo(QDebug &dbg) const
+ inline QString className() const override { return "NetworkConnectionEvent"; }
+ inline void debugInfo(QDebug &dbg) const override
{
NetworkEvent::debugInfo(dbg);
dbg.nospace() << ", state = " << qPrintable(QString::number(_state));
};
-class NetworkDataEvent : public NetworkEvent
+class COMMON_EXPORT NetworkDataEvent : public NetworkEvent
{
public:
- explicit NetworkDataEvent(EventManager::EventType type, Network *network, const QByteArray &data)
+ explicit NetworkDataEvent(EventManager::EventType type, Network *network, QByteArray data)
: NetworkEvent(type, network),
- _data(data)
+ _data(std::move(data))
{}
inline QByteArray data() const { return _data; }
protected:
explicit NetworkDataEvent(EventManager::EventType type, QVariantMap &map, Network *network);
- void toVariantMap(QVariantMap &map) const;
+ void toVariantMap(QVariantMap &map) const override;
- virtual inline QString className() const { return "NetworkDataEvent"; }
- virtual inline void debugInfo(QDebug &dbg) const
+ inline QString className() const override { return "NetworkDataEvent"; }
+ inline void debugInfo(QDebug &dbg) const override
{
NetworkEvent::debugInfo(dbg);
dbg.nospace() << ", data = " << data();
};
-class NetworkSplitEvent : public NetworkEvent
+class COMMON_EXPORT NetworkSplitEvent : public NetworkEvent
{
public:
explicit NetworkSplitEvent(EventManager::EventType type,
Network *network,
- const QString &channel,
- const QStringList &users,
- const QString &quitMsg)
+ QString channel,
+ QStringList users,
+ QString quitMsg)
: NetworkEvent(type, network),
- _channel(channel),
- _users(users),
- _quitMsg(quitMsg)
+ _channel(std::move(channel)),
+ _users(std::move(users)),
+ _quitMsg(std::move(quitMsg))
{}
inline QString channel() const { return _channel; }
protected:
explicit NetworkSplitEvent(EventManager::EventType type, QVariantMap &map, Network *network);
- void toVariantMap(QVariantMap &map) const;
+ void toVariantMap(QVariantMap &map) const override;
- virtual inline QString className() const { return "NetworkSplitEvent"; }
- virtual inline void debugInfo(QDebug &dbg) const
+ inline QString className() const override { return "NetworkSplitEvent"; }
+ inline void debugInfo(QDebug &dbg) const override
{
NetworkEvent::debugInfo(dbg);
dbg.nospace() << ", channel = " << qPrintable(channel())
friend class NetworkEvent;
};
-
-
-#endif