From: Manuel Nickschas Date: Wed, 25 Feb 2009 19:21:06 +0000 (+0100) Subject: Always put own nick last in nick completion X-Git-Tag: 0.5-rc1~341 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=9a1714ad05614440e6dae848903fdf7c875a05e1 Always put own nick last in nick completion --- diff --git a/src/uisupport/tabcompleter.cpp b/src/uisupport/tabcompleter.cpp index 311801a6..695923fd 100644 --- a/src/uisupport/tabcompleter.cpp +++ b/src/uisupport/tabcompleter.cpp @@ -150,7 +150,13 @@ bool TabCompleter::eventFilter(QObject *obj, QEvent *event) { // this determines the sort order bool TabCompleter::CompletionKey::operator<(const CompletionKey &other) const { IrcUser *thisUser = _currentNetwork->ircUser(this->nick); + if(thisUser && _currentNetwork->isMe(thisUser)) + return false; + IrcUser *thatUser = _currentNetwork->ircUser(other.nick); + if(thatUser && _currentNetwork->isMe(thatUser)) + return true; + if(!thisUser || !thatUser) return QString::localeAwareCompare(this->nick, other.nick) < 0;