From kde-core-devel Fri Mar 13 00:29:15 2009 From: David Faure Date: Fri, 13 Mar 2009 00:29:15 +0000 To: kde-core-devel Subject: Re: Fwd: KFileDialog combined keyword/filename suggestion Message-Id: <200903130129.15685.faure () kde ! org> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=123690421406525 On Wednesday 11 March 2009, Jonathan Marten wrote: > Albert Astals Cid writes: > > You forgot to attach the patch :D > > It's attached to the bug report > (https://bugs.kde.org/show_bug.cgi?id=186230). Follows here too... No objections from me. (Can't be 100% sure that there are no regressions, of course, I don't know that code enough). Just one thing that could be simplified: + startDir.adjustPath(KUrl::RemoveTrailingSlash); + filename = startDir.fileName(); + startDir.setFileName(QString()); would be more usually done as: filename = startDir.fileName(); // KUrl::IgnoreTrailingSlash is default anyway startDir.setPath(startDir.directory()); Same for: + KUrl u(url); + u.setFileName(""); I would do u.setPath(u.directory()) instead. Especially since that's exactly what the if() tests, so it would be more consistent. -- David Faure, faure@kde.org, sponsored by Qt Software @ Nokia to work on KDE, Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).