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

List:       kde-core-devel
Subject:    Re: KFileDialog, KFileTreeView, KDirLister, something's broken
From:       Klaas Freitag <freitag () suse ! de>
Date:       2002-01-31 13:12:00
[Download RAW message or body]

On Thu, 31 Jan 2002, Michael Brade wrote:

> On Thursday 31 January 2002 11:23, Neil Stevens wrote:
> > If you use a KFileDialog to get a directory, then pass that directory to a
> > KFileTreeView, the KFileTreeView gets no items.  Can anyone help me figure
> > out what's wrong?
> Yes, found it. The problem was that KFileTreeView::addBranch started the
> listing without the signals from KFileTreeBranch connected. Later on
> KFileTreeBranch::populate() was called which resulted in an
> KDirLister::openURL() but since the lister already listed the url it just
> called updateDirectory() which yielded no new files.
Definitely.

>
> The attached patch fixes it by not calling setOpen which emits the expanded()
> signal which in turn results in populate. This also prevents
> KFileTreeBranch::addBranch to immediately start the listing. However, just
> calling populate() after addBranch() will not open the item, the user has
> still to click on it. So is there any method to open the item without
> emitting expanded? (apart from using blockSignals()?)

Hmm, maybe the best solution is not to call populateBranch(). Since the
population of the branch should not be done until the dir is opened and since
this is triggered by the expanded signal, the best solution is probably to

- call AddBranch to create a new branch
- do NOT call populateBranch()
- get the root item with newBranch->root()
- call root->setOpen( true ) if desired.


If you agree, I will check it in.

>
> Oh, and the patch fixes "the animation is started after it is stopped" as
> well.
Cool. That bug I saw _sometimes_ and had no idea what the reason was.
>

Thanks,

Klaas

>
>

-- 
 ----------------------------------------------------------------------
 Ja mach nur einen Plan und sei ein grosses Licht         Klaas Freitag
 dann mach noch einen zweiten Plan    *            mail freitag@suse.de
 gehn tun sie beide nicht. - B. Brecht             SuSE Labs, Nuernberg
 ----------------------------------------------------------------------

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

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