KIO::ListJob::entries emits twice for folders with 100+ entries. Why?

Mark markg85 at gmail.com
Wed Nov 14 16:32:35 GMT 2012


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).
Results only emits once and when expected.


Cheers,
Mark

[1] http://api.kde.org/4.x-api/kdelibs-apidocs/kio/html/classKIO_1_1ListJob.html#a810353a77053b141c30691265f956dff
[2] http://paste.kde.org/606608/




More information about the kde-core-devel mailing list