Select a directory with KFileWidget?

Andreas Pakulat apaku at gmx.de
Thu Jan 15 23:04:05 GMT 2009


On 13.01.09 20:29:31, David Faure wrote:
> On Saturday 10 January 2009, Andreas Pakulat wrote:
> > Done that, though I didn't dig too deep into the codebase. One thing that
> > annoys me about KFileWidget is that its not really been written with
> > embedding it "anywhere" in mind, its clearly geared towards embedding into
> > a KDialog as a filedialog. Not even easily usable in a wizard dialog.
> 
> Well, I splitted it out of KFileDialog -with- that use case in mind (being able
> to embed it as a widget anywhere else), but of course there was no time to
> actually test that. Looks like you're simply missing signals? That should be
> easy to add, no?

I guess "easy" depends on how much one knows KFileWidget :) Especially
all the connections between the widgets and double vs. single click mode
make it not so easy to emit the right signals in all cases. 

I could solve my problem without a new signal, but it would've helped my
use-case if there were a signal thats emitted whenever the "current url"
changed, i.e. by editing the line-edit, by choosing something from
places, by entering/leaving a dir in the dir-op, by using the toolbar or
when selecting a file in the dir-op. I thought fileHighlighted would do
the job for me, but thats only emitted when clicking a file in the
dir-op.

Just in case you're curious: I'm embedding KFileWidget into a wizard
which allows to select various types of files or dirs and I need to
update the wizards state based on the selected file/directory. The
selection from KFileWidget dictates wether there's another page and the
page is valid at all. So I just need a notification whenever the user
navigates to some place in the KFileWidget.
 
> > Anyway, my "solution" for KDE4.2 code is simply finding the KDirOperator
> > and connecting its urlEntered signal, as well as using the locationEdit's
> > editTextChanged signal.  This way I get notified about any of the changes
> > in the dialog wrt.  switching to a different directory or selecting some
> > file. Which allows me to update my wizard state apropriately. 
> > 
> > For 4.3 it would be nice if we could expose the KDirOperator via a new
> > non-virtual access or KFileWidget.
> 
> OK.

Comitted this: r911699

Andreas

-- 
You are dishonest, but never to the point of hurting a friend.




More information about the kde-core-devel mailing list