[extra patch] Re: KFileWidget: fix changing the current dir using url combo box

David Faure faure at kde.org
Sat Apr 12 00:17:01 BST 2008


On Saturday 12 April 2008, Jaroslaw Staniek wrote:
> David Faure said the following, On 2008-04-11 23:31:
> > On Friday 11 April 2008, Jarosław Staniek wrote:
> >> for review:
> >>
> >> Fix changing the current dir using the 'recent url' combo box.
> >> Upon accepting new url in the 'directory' url combo box, append '/' if needed: 
> >> the combo does not add it, but tokenize() expects it because uses 
> >> KUrl::setFileName(), which would silently remove the last segment of the path.
> > 
> > So it should probably use addPath() instead of setFileName()?
> 
> That was somewhat my first thought, but it'd be too easy.
> I am afraid we could end up with nonexisting paths like /foo/bar even when 
> /foo was a file. In my patch we're appending '/' explicitely when we know that 
> the path points to a directory.
> 
> Another, and probably the last place when we have to care about trailing 
> slashes for dirs, is kdiroperator; see this additional patch:

Both patches look ok to me.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list