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

List:       kde-core-devel
Subject:    Re: [PATCH] KDirLister: emitChanges, deleteItems
From:       Michael Brade <brade () kde ! org>
Date:       2002-03-07 10:56:02
[Download RAW message or body]

On Thursday 07 March 2002 11:37, David Faure wrote:
> On Thursday 07 March 2002 11:23, Michael Brade wrote:
> > Ok, so there's one answer missing: where's the difference between
> > KURL::directory() and KURL::path()? I had a short look at KURL's code but
> > I only understood the code for directory() and I think the docu is not
> > the best it could have ;)
>
> Generally speaking directory() is about finding the directory containing
> that 'URL'. If the URL points to a file, then it's quite obvious,
> directory() will return the path to the parent directory.
> The tricky case is if the URL itself points to a directory, in which case
> it depends on the second bool passed to directory(), whether it should
> return the URL itself (it's a directory) or its parent directory.
damn, wrong answer ;-)) That's what I know already because I understood the 
code for directory(), what's missing is the description for path()... would 
you like to answer again? :)

> In your case, I suppose you want to make a special case of "the url is a
> directory" anyway, to look into the 'root' items as well, for those?
right. and that's why I searched for something that strips only the filename 
from an url. Seems that's not possible...

> > > Ok. What about looking for the item in the "items already created but
> > > not yet emitted" buffer then? If it can be updated there, then the
> > > correct version of the item will be emitted at the end of the listing
> > > (openURL or update, doesn't matter). Then it's not even needed to emit
> > > refreshItems in such a case.
> >
> > Hmm, right, I guess you mean the buffer in KDirListerCache::jobs. But I
> > meant that the job itself picks up the item but does not emit entries()
> > yet.
>
> But it will emit it when it's complete, right ?
> All that matters is that the item gets updated, the emission to the view
> can wait until the next emit newItems(). Do I misunderstand what you say?
I don't know... the slave itself has something like a small buffer which is 
emitted at one time. What I meant is that the file is in the buffer of slave, 
then changed, then FilesChanged is called (whoops, we don't have it yet 
*anywhere*) then the slave emits entries().
But I know how to fix this: just extract the complete url from the file 
(without the filename) and stop any updates and listings that are running in 
this directory _if_ the file is not in KDirListerCache yet. However, the next 
line still stands...

> > Perhaps a very rare case we don't have to deal with?
>
> Hmm, that's my line usually ;)
:)

-- 
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'
  °--web: http://www.kde.org/people/michaelb.html

KDE 3.0: Konquering the Desktops


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

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