X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcoreirclisthelper.cpp;h=927af37bc2d42a307d97252cef66ef06be41fab8;hp=9ff68fae8dc8e7663b86690c97afeb8808947b56;hb=HEAD;hpb=3e63cb8a6e83765069a45101b86ae9e21dcc57ad diff --git a/src/core/coreirclisthelper.cpp b/src/core/coreirclisthelper.cpp index 9ff68fae..927af37b 100644 --- a/src/core/coreirclisthelper.cpp +++ b/src/core/coreirclisthelper.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2018 by the Quassel Project * + * Copyright (C) 2005-2022 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -25,7 +25,7 @@ constexpr auto kTimeoutMs = 5000; -QVariantList CoreIrcListHelper::requestChannelList(const NetworkId &netId, const QStringList &channelFilters) +QVariantList CoreIrcListHelper::requestChannelList(const NetworkId& netId, const QStringList& channelFilters) { if (_finishedChannelLists.contains(netId)) return _finishedChannelLists.take(netId); @@ -39,8 +39,7 @@ QVariantList CoreIrcListHelper::requestChannelList(const NetworkId &netId, const return QVariantList(); } - -bool CoreIrcListHelper::addChannel(const NetworkId &netId, const QString &channelName, quint32 userCount, const QString &topic) +bool CoreIrcListHelper::addChannel(const NetworkId& netId, const QString& channelName, quint32 userCount, const QString& topic) { if (!_channelLists.contains(netId)) return false; @@ -52,10 +51,9 @@ bool CoreIrcListHelper::addChannel(const NetworkId &netId, const QString &channe return true; } - -bool CoreIrcListHelper::dispatchQuery(const NetworkId &netId, const QString &query) +bool CoreIrcListHelper::dispatchQuery(const NetworkId& netId, const QString& query) { - CoreNetwork *network = coreSession()->network(netId); + CoreNetwork* network = coreSession()->network(netId); if (network) { _channelLists[netId] = QList(); network->userInputHandler()->handleList(BufferInfo(), query); @@ -72,27 +70,24 @@ bool CoreIrcListHelper::dispatchQuery(const NetworkId &netId, const QString &que } } - -bool CoreIrcListHelper::endOfChannelList(const NetworkId &netId) +bool CoreIrcListHelper::endOfChannelList(const NetworkId& netId) { if (_queryTimeoutByNetId.contains(netId)) { - // If we recieved an actual RPL_LISTEND, remove the timer + // If we received an actual RPL_LISTEND, remove the timer int timerId = _queryTimeoutByNetId.take(netId)->timerId(); _queryTimeoutByTimerId.remove(timerId); } if (_queuedQuery.contains(netId)) { - // we're no longer interessted in the current data. drop it and issue a new request. + // we're no longer interested in the current data. drop it and issue a new request. return dispatchQuery(netId, _queuedQuery.take(netId)); } else if (_channelLists.contains(netId)) { QVariantList channelList; - foreach(ChannelDescription channel, _channelLists[netId]) { + foreach (ChannelDescription channel, _channelLists[netId]) { QVariantList channelVariant; - channelVariant << channel.channelName - << channel.userCount - << channel.topic; - channelList << qVariantFromValue(channelVariant); + channelVariant << channel.channelName << channel.userCount << channel.topic; + channelList << QVariant::fromValue(channelVariant); } _finishedChannelLists[netId] = channelList; _channelLists.remove(netId); @@ -104,8 +99,7 @@ bool CoreIrcListHelper::endOfChannelList(const NetworkId &netId) } } - -void CoreIrcListHelper::timerEvent(QTimerEvent *event) +void CoreIrcListHelper::timerEvent(QTimerEvent* event) { if (!_queryTimeoutByTimerId.contains(event->timerId())) { IrcListHelper::timerEvent(event);