Heads up, working on autocompletion and breadcrumbbar!

Mark markg85 at gmail.com
Sun Jan 29 16:10:04 UTC 2012


On Wed, Jan 18, 2012 at 4:40 PM, Mark <markg85 at gmail.com> wrote:

> On Wed, Jan 18, 2012 at 11:06 AM, Alin M Elena <alinm.elena at gmail.com>wrote:
>
>> Hi Mark,
>>
>> I was reading about your autocompleter.
>> I have few questions... is it able to use a kde spelling dictionary for
>> it?
>> I ask that because would be interesting to have it in ktp-text-ui
>> component of
>> kde-telepathy...
>>
>>
>> regards,
>> Alin
>>
>> Hi Alin,
>
> At this moment it doesn't have that and i wasn't planning on implementing
> it. You are however free to patch it with spelling support. As long as it's
> optional.
> I will send the current C++ code that i have for the autocompleter to this
> thread somewhere tonight.
>
> Regards,
> Mark
>

Better late then never, right ;)

Here is the code for the string completion part.
The class is extremely simple. All you need to do is call setData which
accepts a stringlist. Then call search("needle") and it will emit every
result it finds.
The way i used this is by making a second class that (in my case) does the
file system listDir function, makes a list and sends it to the
stringcompleter and i let that run in a seperate thread:

StringCompleter completer();
QThread myThread();
completer.moveToThread(&myThread);

... connect the signals to corresponding functions:
QObject::connect(&completer, SIGNAL(searchCompleted(QStringList,QString)),
this, SLOT( ... ));
QObject::connect(&completer, SIGNAL(searchHit(QString)), this, SLOT( ... ));

That way searching won't block anything :)

Up until now i was just experimenting with this and used the
StringCompleter along with QDir directly.. Next up: more serious
experimentation, but with KIO! Fingers crossed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20120129/95e16c08/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stringcompleter.zip
Type: application/zip
Size: 1323 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20120129/95e16c08/attachment.zip>


More information about the Plasma-devel mailing list