From 9a1714ad05614440e6dae848903fdf7c875a05e1 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Wed, 25 Feb 2009 20:21:06 +0100 Subject: [PATCH] Always put own nick last in nick completion --- src/uisupport/tabcompleter.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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; -- 2.20.1