X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Ftabcompleter.cpp;h=957ddb00e3e58bec3da7526ecccfb38838d85a13;hp=5cc80c9d8692a8d5a75588a44498ec6f52b68aae;hb=e2188dc438be6f3eb0d9cdf47d28821aefe9835e;hpb=951cd716c8c84f4ad340c9fbd57f0d9d4aa3f951 diff --git a/src/uisupport/tabcompleter.cpp b/src/uisupport/tabcompleter.cpp index 5cc80c9d..957ddb00 100644 --- a/src/uisupport/tabcompleter.cpp +++ b/src/uisupport/tabcompleter.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2014 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -109,6 +109,7 @@ void TabCompleter::buildCompletionList() case BufferInfo::QueryBuffer: if (regex.indexIn(_currentBufferName) > -1) _completionMap[_currentBufferName.toLower()] = _currentBufferName; + // fallthrough case BufferInfo::StatusBuffer: if (!_currentNetwork->myNick().isEmpty() && regex.indexIn(_currentNetwork->myNick()) > -1) _completionMap[_currentNetwork->myNick().toLower()] = _currentNetwork->myNick(); @@ -152,7 +153,7 @@ void TabCompleter::complete() _lastCompletionLength += _nickSuffix.length(); } else if (s.addSpaceMidSentence()) { - _lineEdit->insert(" "); + _lineEdit->addCompletionSpace(); _lastCompletionLength++; } @@ -178,7 +179,7 @@ bool TabCompleter::eventFilter(QObject *obj, QEvent *event) if (obj != _lineEdit || event->type() != QEvent::KeyPress) return QObject::eventFilter(obj, event); - QKeyEvent *keyEvent = static_cast(event); + auto *keyEvent = static_cast(event); if (keyEvent->key() == GraphicalUi::actionCollection("General")->action("TabCompletionKey")->shortcut()[0]) complete();