X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fcoreircchannel.cpp;h=b2e41a94fcc9940c04e4a4e8f3c8fb3e97b4fc35;hb=d030c159599a22c9023b8f0d34909d3277707f52;hp=c2745a8ea6e36b6561590266ef30c5fbe3f022cf;hpb=f8851271f84e262bfd38f18aa76e78d20f4f5602;p=quassel.git diff --git a/src/core/coreircchannel.cpp b/src/core/coreircchannel.cpp index c2745a8e..b2e41a94 100644 --- a/src/core/coreircchannel.cpp +++ b/src/core/coreircchannel.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2015 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 * @@ -19,18 +19,18 @@ ***************************************************************************/ #include "coreircchannel.h" + #include "corenetwork.h" -INIT_SYNCABLE_OBJECT(CoreIrcChannel) -CoreIrcChannel::CoreIrcChannel(const QString &channelname, Network *network) - : IrcChannel(channelname, network), - _receivedWelcomeMsg(false) +CoreIrcChannel::CoreIrcChannel(const QString& channelname, Network* network) + : IrcChannel(channelname, network) + , _receivedWelcomeMsg(false) { #ifdef HAVE_QCA2 - _cipher = 0; + _cipher = nullptr; // Get the cipher key from CoreNetwork if present - CoreNetwork *coreNetwork = qobject_cast(network); + auto* coreNetwork = qobject_cast(network); if (coreNetwork) { QByteArray key = coreNetwork->readChannelCipherKey(channelname); if (!key.isEmpty()) { @@ -40,7 +40,6 @@ CoreIrcChannel::CoreIrcChannel(const QString &channelname, Network *network) #endif } - CoreIrcChannel::~CoreIrcChannel() { #ifdef HAVE_QCA2 @@ -48,7 +47,7 @@ CoreIrcChannel::~CoreIrcChannel() // exists. There is no need to store the empty key if no cipher exists; no // key was present when instantiating and no key was set during the // channel's lifetime. - CoreNetwork *coreNetwork = qobject_cast(network()); + auto* coreNetwork = qobject_cast(network()); if (coreNetwork && _cipher) { coreNetwork->storeChannelCipherKey(name(), _cipher->key()); } @@ -57,9 +56,8 @@ CoreIrcChannel::~CoreIrcChannel() #endif } - #ifdef HAVE_QCA2 -Cipher *CoreIrcChannel::cipher() const +Cipher* CoreIrcChannel::cipher() const { if (!_cipher) _cipher = new Cipher(); @@ -67,7 +65,6 @@ Cipher *CoreIrcChannel::cipher() const return _cipher; } - void CoreIrcChannel::setEncrypted(bool e) { IrcChannel::setEncrypted(e); @@ -84,5 +81,4 @@ void CoreIrcChannel::setEncrypted(bool e) } } - #endif