[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Re: Heads up, working on autocompletion and breadcrumbbar!
From:       Mark <markg85 () gmail ! com>
Date:       2012-01-29 16:10:04
Message-ID: CAPd6JnGf8yrFBerM+Jq5ZhzGDPM0m4y3RujfEVLGxRQyR-TqnQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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

> On Wed, Jan 18, 2012 at 11:06 AM, Alin M Elena <alinm.elena@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.

[Attachment #5 (text/html)]

<div class="gmail_quote">On Wed, Jan 18, 2012 at 4:40 PM, Mark <span dir="ltr">&lt;<a \
href="mailto:markg85@gmail.com">markg85@gmail.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex">

<div class="gmail_quote"><div class="im">On Wed, Jan 18, 2012 at 11:06 AM, Alin M \
Elena <span dir="ltr">&lt;<a href="mailto:alinm.elena@gmail.com" \
target="_blank">alinm.elena@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">


Hi Mark,<br>
<br>
I was reading about your autocompleter.<br>
I have few questions... is it able to use a kde spelling dictionary for it?<br>
I ask that because would be interesting to have it in ktp-text-ui component of<br>
kde-telepathy...<br>
<br>
<br>
regards,<br>
Alin<br><br></blockquote></div><div>Hi Alin,</div><div><br></div><div>At this moment \
it doesn&#39;t have that and i wasn&#39;t planning on implementing it. You are \
however free to patch it with spelling support. As long as it&#39;s optional.</div>


<div>I will send the current C++ code that i have for the autocompleter to this \
thread somewhere tonight.</div><div><br></div><div>Regards,</div><span \
class="HOEnZb"><font color="#888888"><div>Mark</div></font></span></div>


</blockquote></div><br><div>Better late then never, right \
;)</div><div><br></div><div>Here is the code for the string completion \
part.</div><div>The class is extremely simple. All you need to do is call setData \
which accepts a stringlist. Then call search(&quot;needle&quot;) and it will emit \
every result it finds.</div>

<div>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:</div><div><br></div>

<div>StringCompleter completer();</div>QThread \
myThread();<div>completer.moveToThread(&amp;myThread);</div><div><br></div><div>... \
connect the signals to corresponding functions:</div>    \
QObject::connect(&amp;completer, SIGNAL(searchCompleted(QStringList,QString)), this, \
SLOT( ... ));<br>

QObject::connect(&amp;completer, SIGNAL(searchHit(QString)), this, SLOT( ... \
));<div><br></div><div>That way searching won&#39;t block anything \
:)</div><div><br></div><div>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.</div>


--20cf303b39fdaa37f504b7acf7c4--


["stringcompleter.zip" (application/zip)]

_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic