X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Fdccconfig.cpp;h=800ae885f887878b35f1590ac1246d18d4f176da;hb=d9026a22f17d5f8b2734cbf0348ad35de5b13f0b;hp=7767735c1bf6699005290852c714796853d74ca3;hpb=3e63cb8a6e83765069a45101b86ae9e21dcc57ad;p=quassel.git diff --git a/src/common/dccconfig.cpp b/src/common/dccconfig.cpp index 7767735c..800ae885 100644 --- a/src/common/dccconfig.cpp +++ b/src/common/dccconfig.cpp @@ -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 * @@ -24,8 +24,8 @@ #include "types.h" -DccConfig::DccConfig(QObject *parent) - : SyncableObject(parent) +DccConfig::DccConfig(QObject* parent) + : SyncableObject("DccConfig", parent) { static auto regTypes = []() -> bool { qRegisterMetaTypeStreamOperators("DccConfig::IpDetectionMode"); @@ -34,12 +34,10 @@ DccConfig::DccConfig(QObject *parent) }(); Q_UNUSED(regTypes); - renameObject("DccConfig"); setAllowClientUpdates(true); } - -DccConfig &DccConfig::operator=(const DccConfig &other) +DccConfig& DccConfig::operator=(const DccConfig& other) { if (this == &other) return *this; @@ -55,8 +53,7 @@ DccConfig &DccConfig::operator=(const DccConfig &other) return *this; } - -bool DccConfig::operator==(const DccConfig &other) +bool DccConfig::operator==(const DccConfig& other) { // NOTE: We don't compare the SyncableObject attributes (isInitialized, clientUpdatesAllowed()) static auto propCount = staticMetaObject.propertyCount(); @@ -70,126 +67,106 @@ bool DccConfig::operator==(const DccConfig &other) return false; } else if (property(propName) != other.property(propName)) - return false; + return false; } return true; } - bool DccConfig::isDccEnabled() const { return _dccEnabled; } - void DccConfig::setDccEnabled(bool enabled) { _dccEnabled = enabled; } - QHostAddress DccConfig::outgoingIp() const { return _outgoingIp; } - -void DccConfig::setOutgoingIp(const QHostAddress &outgoingIp) +void DccConfig::setOutgoingIp(const QHostAddress& outgoingIp) { _outgoingIp = outgoingIp; } - DccConfig::IpDetectionMode DccConfig::ipDetectionMode() const { return _ipDetectionMode; } - void DccConfig::setIpDetectionMode(DccConfig::IpDetectionMode detectionMode) { _ipDetectionMode = detectionMode; } - DccConfig::PortSelectionMode DccConfig::portSelectionMode() const { return _portSelectionMode; } - void DccConfig::setPortSelectionMode(DccConfig::PortSelectionMode portSelectionMode) { _portSelectionMode = portSelectionMode; } - quint16 DccConfig::minPort() const { return _minPort; } - void DccConfig::setMinPort(quint16 port) { _minPort = port; } - quint16 DccConfig::maxPort() const { return _maxPort; } - void DccConfig::setMaxPort(quint16 port) { _maxPort = port; } - int DccConfig::chunkSize() const { return _chunkSize; } - void DccConfig::setChunkSize(int chunkSize) { _chunkSize = chunkSize; } - int DccConfig::sendTimeout() const { return _sendTimeout; } - void DccConfig::setSendTimeout(int timeout) { _sendTimeout = timeout; } - bool DccConfig::usePassiveDcc() const { return _usePassiveDcc; } - void DccConfig::setUsePassiveDcc(bool use) { _usePassiveDcc = use; } - bool DccConfig::useFastSend() const { return _useFastSend; } - void DccConfig::setUseFastSend(bool use) { _useFastSend = use;