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

List:       kde-devel
Subject:    Re: Question regarding KFileDialog (KDE4)
From:       Albert Astals Cid <aacid () kde ! org>
Date:       2009-02-26 21:23:12
Message-ID: 200902262223.13505.aacid () kde ! org
[Download RAW message or body]

A Dijous, 26 de febrer de 2009, Jonathan Marten va escriure:
> Hello all,
>
> I'm sure that I'm not the first person to have tried to do this, or
> have worked around it.  But I'd be interested to know if there is a
> standard way to achieve what would seem to be "the right thing" from
> an application.
>
> Especially for saving, there doesn't seem to be any way, using the
> static functions in KFileDialog, to specify both a "last used starting
> directory" and a "suggested file name".  There is the 'startDir'
> parameter, and this can be "kfiledialog:///keyword" to specify the the
> saved location keyword, but using this option there is no way to
> specify a suggested file name.  Or this parameter can be the suggested
> file name, but in this case there is no way to specify a saved
> location keyword.  Or it can be a full URL, specifying a directory and
> filename, but in this case there is no support for the saved location
> keyword.
>
> So an application which tries to remember its save location, for example
> extragear/base/konq-plugins/webarchiver/plugin_webarchiver.cpp, saves
> the last-used-directory itself in its config file.  This works, but
> defeats the purpose of having the KFileDialog keyword support.  Having
> every application doing its own thing can't be good for coding
> consistency, if nothing else.  krecentdirs.h is not installed, so I
> assume that this class is intended for internal use by kfile only.
>
> The other option seems to be to explicitly create a KFileDialog
> instead of using the static functions, then the keyword can be
> specified in the constructor and the suggested file name set with
> setSelection().  But in this case, there's no point having the more
> convenient static functions.
>
> I've had some thoughts about how this (apparent) anomaly could be
> fixed, but would just like to confirm that I haven't missed anything
> first...

I've had in my todo file adding a new method to KFileDialog so you can both 
state a kfiledialog:///keyword and a suggested name for ages so it would be 
cool if you can do a patch that does it ;-)

Albert

>
> Regards,
>   Jonathan


 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

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