Slows starting of downloading with KIO
brade at kde.org
Mon Jan 2 11:22:29 GMT 2006
On Monday 02 January 2006 11:22, David Faure wrote:
> On Sunday 01 January 2006 21:17, Michael Brade wrote:
> > Good point, we should make itemsForDir() static as well and rename it to
> > itemsForURL().
> I prefer itemsForDir, it's clear that it's about all the items for a
> directory. Otherwise we have itemForURL (for a file) and itemsForURL (for a
> directory), which look too much like each other.
Ah, ok then, makes sense.
> > Which method to use. Well, not sure, itemForURL sounds good if we can
> > make the lookup more efficient that way. Because if all you need is a
> > file most of the time or even the whole contents of a directory then
> > itemForURL wouldn't gain us much. But if you possibly need the directory
> > item itself we might be better off with a new itemForURL method indeed.
> Hmm, all I need is one item (one file or directory) most of the time, and
> this is why I was suggesting itemForURL() - it would fine the right
> KFileItem for the item (file/directory) whose URL is given. I think you
> misunderstood with "url == url of the directory".
No, I don't think so.. currently in a treeview there is no way to get the root
file item for a directory B if directory A is the root directory of the
KDirLister and A is not a parent of B. So if you need that directory item
then we have to add this itemForURL().
Looking at the KDirLister API, I think we should also change rootItem() to
rootItem( const KURL& = KURL() ) to add this missing functionality to a local
KDirLister, it would return the root item of the lister if no url is given,
otherwise it would return the root item of the given directory. Or add a new
method rootItemForDir( const KURL& ). [I'd prefer the rootItem() change]
> > About the naming, it should be consistent: we have
> > KDirLister::findByURL() and findByName() already. So call all static
> > methods querying the global items item(s)*() and all methods operating on
> > the files the KDirLister holds find*()? Suggestions?
> Oh, I see; tricky.
> I think the static methods should be cachedItemForURL and
> cachedItemsForDir, that way it's clear that the caller might get nothing in
> return, when the directory hasn't been listed yet, or has been removed from
> the cache for any reason. Otherwise I foresee people assuming that
> KDirLister::itemForURL()/itemsForDir() will take care of everything
Ok, sounds good. Will add that stuff.
> [synchronous directory listing over kio? no thank s :)].
Michael Brade; KDE Developer, Student of Computer Science
|-mail: echo brade !#|tr -d "c oh"|s\e\d 's/e/\@/2;s/$/.org/;s/bra/k/2'
KDE 3: The Next Generation in Desktop Experience
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
More information about the kde-core-devel