X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fdccconfig.h;h=67fd9ef2d2af82411eec397878fd58331a853637;hp=c82830aca8763ac814df0fd7be9446357a990b15;hb=cc21148ce02b9dd111e9821411846541187297bb;hpb=3e63cb8a6e83765069a45101b86ae9e21dcc57ad diff --git a/src/common/dccconfig.h b/src/common/dccconfig.h index c82830ac..67fd9ef2 100644 --- a/src/common/dccconfig.h +++ b/src/common/dccconfig.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2018 by the Quassel Project * + * Copyright (C) 2005-2019 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -20,6 +20,8 @@ #pragma once +#include "common-export.h" + #include #include "syncableobject.h" @@ -30,7 +32,7 @@ * @warning Equality and assignment operators are optimized for use in a settings page * and do not cover all attributes! */ -class DccConfig : public SyncableObject +class COMMON_EXPORT DccConfig : public SyncableObject { Q_OBJECT SYNCABLE_OBJECT @@ -60,7 +62,8 @@ public: /** * Mode for detecting the outgoing IP */ - enum class IpDetectionMode : quint8 { + enum class IpDetectionMode : quint8 + { Automatic, ///< Automatic detection (network socket or USERHOST) Manual, ///< Manually specified IP }; @@ -69,9 +72,10 @@ public: /** * Mode for selecting the port range for DCC */ - enum class PortSelectionMode : quint8 { - Automatic, ///< Automatic port selection - Manual, ///< Manually specified port range + enum class PortSelectionMode : quint8 + { + Automatic, ///< Automatic port selection + Manual, ///< Manually specified port range }; Q_ENUMS(PortSelectionMode) @@ -82,17 +86,7 @@ public: * * @param[in] parent QObject parent */ - DccConfig(QObject *parent = nullptr); - - /** - * Assignment operator. - * - * @note Only assigns properties relevant for config management! - * - * @param[in] other Right-hand side instance - * @returns The updated instance - */ - DccConfig &operator=(const DccConfig &other); + DccConfig(QObject* parent = nullptr); /** * Equality operator. @@ -102,7 +96,7 @@ public: * @param[in] other Right-hand side instance * @returns Whether the two instances have equal properties */ - bool operator==(const DccConfig &other); + bool operator==(const DccConfig& other); /// @name Getters /// @{ @@ -122,7 +116,7 @@ public slots: /// @name Setters /// @{ void setDccEnabled(bool enabled); - void setOutgoingIp(const QHostAddress &outgoingIp); + void setOutgoingIp(const QHostAddress& outgoingIp); void setIpDetectionMode(DccConfig::IpDetectionMode ipDetectionMode); void setPortSelectionMode(DccConfig::PortSelectionMode portSelectionMode); void setMinPort(quint16 port); @@ -135,14 +129,14 @@ public slots: private: // The given values are used as default for both initialization and settings - bool _dccEnabled {false}; - QHostAddress _outgoingIp {QHostAddress::LocalHost}; - IpDetectionMode _ipDetectionMode {IpDetectionMode::Automatic}; - PortSelectionMode _portSelectionMode {PortSelectionMode::Automatic}; - quint16 _minPort {1024}; - quint16 _maxPort {32767}; - int _chunkSize {16}; - int _sendTimeout {180}; - bool _usePassiveDcc {false}; - bool _useFastSend {false}; + bool _dccEnabled{false}; + QHostAddress _outgoingIp{QHostAddress::LocalHost}; + IpDetectionMode _ipDetectionMode{IpDetectionMode::Automatic}; + PortSelectionMode _portSelectionMode{PortSelectionMode::Automatic}; + quint16 _minPort{1024}; + quint16 _maxPort{32767}; + int _chunkSize{16}; + int _sendTimeout{180}; + bool _usePassiveDcc{false}; + bool _useFastSend{false}; };