From: Marcus Eggenberger Date: Fri, 11 Jul 2008 12:14:29 +0000 (+0200) Subject: fixing scope issue X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=31b3ceea2560ab94c1747a70a024a99250df88b6 fixing scope issue --- diff --git a/src/uisupport/tabcompleter.cpp b/src/uisupport/tabcompleter.cpp index e9edf035..6b5e9b2c 100644 --- a/src/uisupport/tabcompleter.cpp +++ b/src/uisupport/tabcompleter.cpp @@ -62,12 +62,14 @@ void TabCompleter::buildCompletionList() { switch(static_cast(currentIndex.data(NetworkModel::BufferTypeRole).toInt())) { case BufferInfo::ChannelBuffer: - IrcChannel *channel = network->ircChannel(bufferName); - if(!channel) - return; - foreach(IrcUser *ircUser, channel->ircUsers()) { - if(regex.indexIn(ircUser->nick()) > -1) - completionMap[ircUser->nick().toLower()] = ircUser->nick(); + { // scope is needed for local var declaration + IrcChannel *channel = network->ircChannel(bufferName); + if(!channel) + return; + foreach(IrcUser *ircUser, channel->ircUsers()) { + if(regex.indexIn(ircUser->nick()) > -1) + completionMap[ircUser->nick().toLower()] = ircUser->nick(); + } } break; case BufferInfo::QueryBuffer: