KIO::ListJob::entries emits twice for folders with 100+ entries. Why?
Frank Reininghaus
frank78ac at googlemail.com
Thu Nov 22 11:43:13 GMT 2012
2012/11/22 David Faure:
[...]
>> As a last remark regarding your dolphin example. If you open up a
>> large folder in dolphin you will see that dolphin waits till it has
>> all the contents of it. Then it starts displaying those. So in other
>> terms, it doesn't even benefit!
>
> Don't blame KIO if the new views in dolphin misbehave :-)
>
> This used to be working fine with the Model/View based widgets. If something
> regressed with the new hand-written views in dolphin, then dolphin should be
> fixed. To test what KIO was written for initially, use the file dialog instead.
I just looked at the relevant code (not written by myself) to find out
something about this 'misbehaviour'.
The slot in KFileItemModel which is connected to KDirLister's
newItems(KFileItemList) signal collects all new items in a sort of
cache (m_pendingItemsToInsert), rather than actually inserting them
into the model, until either
a) the completed() signal is received, or
b) two seconds have passed.
To be honest, I cannot say at the moment what the reason for this
design decision is. I could imagine that it is to prevent unnecessary
small, but expensive, updates of model+view if newItems() is emitted
many times with just one KFileItem each before the completed() signal
is received. But it seems that this is actually not even possible, if
I understand correctly?
Best regards,
Frank
More information about the kde-core-devel
mailing list