[PATCH] QFileDialog::getExistingDirectory()

Peter Kümmel syntheticpp at gmx.net
Thu Feb 24 12:53:22 CET 2005


Sami Kyostila wrote:
> Hi,
> 
> Here's a patch that (mostly) fixes the defunct
> QFileDialog::getExistingDirectory() function. Two issues are addressed:
> 
> 1. The old code takes the selected path from the pszDisplayName member
> of the LPITEMIDLIST structure. That member only contains the string shown
> to the user in the dialog rather than the full path, making the result
> useless.
>   This patch extracts the resulting path from the value returned by
> SHBrowseForFolder().
> 
> 2. The old code initializes the pidlRoot member of the LPITEMIDLIST
> structure to point to the initial directory given to the function. This is
> incorrect because this actually restricts the file dialog namespace to
> directories below the initial one. That is, if you start at c:\foo\bar,
> you can't go up to c:\foo or even c:\.
>   As far as I can see, there is no way to directly specify the initial
> directory for SHBrowseForFolder(), so this patch just removes the
> namespace root assignment.
> 
> Regards,
> Sami Kyöstilä

Hi Sami,
thanks for your patch!
It's now in the repository.

Regards,
Peter


More information about the kde-cygwin mailing list