From kde-core-devel Fri Oct 21 22:29:30 2011 From: Jaros?aw Staniek Date: Fri, 21 Oct 2011 22:29:30 +0000 To: kde-core-devel Subject: Re: More convenient text completion in KDE UIs Message-Id: <4ea1f28b.0259df0a.33ab.45c0 () mx ! google ! com> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=131923627114896 David Faure wrote: > On Friday 07 October 2011 01:02:50 Jonathan Schmidt-Domine wrote: >> Hi! >> >> Where is it implemented? Is there a clever search index? > > Hi, please keep some context when replying to an email. I can't remember > what "it" is without re-reading the previous mail. > > [Context: substring completion] > > KCompletion::substringCompletion in kdelibs/kdeui/util/kcompletion.cpp > might be what you're looking for. > > It calls KCompletion::extractStringsFromNode which iterates over all > completion nodes, so I guess the answer is no, there is no clever search > index. But since it's called on a (specific) keypress, this hasn't been a > problem until now. It might become a problem if it happens during normal > typing though... Update: I forked QCompleter and added full-text search to get quick and relatively clean result. Code is in calligra/kexi/kexiutils/completer. I gave up with KCompletion for now, it's nice class (and has prefix tree) but QCompleter is younger and has better model/view concepts. Who knows maybe Qt5's QCompleter will be improved [Greetings to people that made qt-project.org possible!] -- regards / pozdrawiam, Jaroslaw Staniek http://www.linkedin.com/in/jstaniek Kexi & Calligra (kexi-project.org, identi.ca/kexi, calligra-suite.org) KDE Software Development Platform on MS Windows (windows.kde.org)