-void CoreIrcListHelper::timerEvent(QTimerEvent *event) {
- int timerId = event->timerId();
- killTimer(timerId);
- NetworkId netId = _queryTimeout.take(timerId);
- endOfChannelList(netId);
+
+bool CoreIrcListHelper::endOfChannelList(const NetworkId &netId)
+{
+ if (_queuedQuery.contains(netId)) {
+ // we're no longer interessted 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]) {
+ QVariantList channelVariant;
+ channelVariant << channel.channelName
+ << channel.userCount
+ << channel.topic;
+ channelList << qVariantFromValue<QVariant>(channelVariant);
+ }
+ _finishedChannelLists[netId] = channelList;
+ _channelLists.remove(netId);
+ reportFinishedList(netId);
+ return true;
+ }
+ else {
+ return false;
+ }
+}
+
+
+void CoreIrcListHelper::timerEvent(QTimerEvent *event)
+{
+ int timerId = event->timerId();
+ killTimer(timerId);
+ NetworkId netId = _queryTimeout.take(timerId);
+ endOfChannelList(netId);