-void TabCompleter::buildCompletionList() {
- // ensure a safe state in case we return early.
- _completionMap.clear();
- _nextCompletion = _completionMap.begin();
-
- // this is the first time tab is pressed -> build up the completion list and it's iterator
- QModelIndex currentIndex = Client::bufferModel()->currentIndex();
- _currentBufferId = currentIndex.data(NetworkModel::BufferIdRole).value<BufferId>();
- if(!_currentBufferId.isValid())
- return;
-
- NetworkId networkId = currentIndex.data(NetworkModel::NetworkIdRole).value<NetworkId>();
- _currentBufferName = currentIndex.sibling(currentIndex.row(), 0).data().toString();
-
- _currentNetwork = Client::network(networkId);
- if(!_currentNetwork)
- return;
-
- QString tabAbbrev = _lineEdit->text().left(_lineEdit->cursorPosition()).section(QRegExp("[^#\\w\\d-_\\[\\]{}|`^.\\\\]"),-1,-1);
- QRegExp regex(QString("^[-_\\[\\]{}|`^.\\\\]*").append(QRegExp::escape(tabAbbrev)), Qt::CaseInsensitive);
-
- // channel completion - add all channels of the current network to the map
- if(tabAbbrev.startsWith('#')) {
- _completionType = ChannelTab;
- foreach(IrcChannel *ircChannel, _currentNetwork->ircChannels()) {
- if(regex.indexIn(ircChannel->name()) > -1)
- _completionMap[ircChannel->name()] = ircChannel->name();
+
+void TabCompleter::buildCompletionList()
+{
+ // ensure a safe state in case we return early.
+ _completionMap.clear();
+ _nextCompletion = _completionMap.begin();
+
+ // this is the first time tab is pressed -> build up the completion list and it's iterator
+ QModelIndex currentIndex = Client::bufferModel()->currentIndex();
+ _currentBufferId = currentIndex.data(NetworkModel::BufferIdRole).value<BufferId>();
+ if (!_currentBufferId.isValid())
+ return;
+
+ NetworkId networkId = currentIndex.data(NetworkModel::NetworkIdRole).value<NetworkId>();
+ _currentBufferName = currentIndex.sibling(currentIndex.row(), 0).data().toString();
+
+ _currentNetwork = Client::network(networkId);
+ if (!_currentNetwork)
+ return;
+
+ QString tabAbbrev = _lineEdit->text().left(_lineEdit->cursorPosition()).section(QRegExp("[^#\\w\\d-_\\[\\]{}|`^.\\\\]"), -1, -1);
+ QRegExp regex(QString("^[-_\\[\\]{}|`^.\\\\]*").append(QRegExp::escape(tabAbbrev)), Qt::CaseInsensitive);
+
+ // channel completion - add all channels of the current network to the map
+ if (tabAbbrev.startsWith('#')) {
+ _completionType = ChannelTab;
+ foreach(IrcChannel *ircChannel, _currentNetwork->ircChannels()) {
+ if (regex.indexIn(ircChannel->name()) > -1)
+ _completionMap[ircChannel->name()] = ircChannel->name();
+ }