KIO::ListJob::entries emits twice for folders with 100+ entries. Why?
Mark
markg85 at gmail.com
Wed Nov 14 23:06:24 GMT 2012
On Wed, Nov 14, 2012 at 10:18 PM, Albert Astals Cid <aacid at kde.org> wrote:
> El Dimecres, 14 de novembre de 2012, a les 17:32:35, Mark va escriure:
>> Hi,
>>
>> I'm playing with KIO::listDir() and the signals to get the directory
>> content and i've hit a strange "issue". Apparently when a folder has
>> more than 100 entries the entries signal [1] will be emitted twice.
>> 1 with 100 entries
>> 1 with all entries
>>
>> Also, this only seems to happen if i add:
>> job->addMetaData("details", "0");
>>
>> See the full code example [2] that also contains the above line.
>>
>> On IRC kde__pepo suggested that the first emit might be so that the
>> app using it has at least some results while waiting for the rest.
>>
>> Whatever the case is, the api documentation [1] is completely silent about
>> this.
>>
>> Is there an option to disable this behavior? In my case i don't want
>> nor need the extra signal and i "was" depending on that signal to
>> properly fill my model. However, since that might be emitted twice it
>> screwed up my logic and my personal workaround is to rather just
>> depend on the results signal (which i can't find in the API docs).
>
> You mean "result" instead of "results", right? I see it documented in the KJob
> class, problaby you want the finished signal, (if it is job being done that you
> are waiting for)
>
> Cheers,
> Albert
>
>> Results only emits once and when expected.
>>
>>
>> Cheers,
>> Mark
>>
>> [1]
>> http://api.kde.org/4.x-api/kdelibs-apidocs/kio/html/classKIO_1_1ListJob.htm
>> l#a810353a77053b141c30691265f956dff [2] http://paste.kde.org/606608/
Yes, i meant result.
More information about the kde-core-devel
mailing list