[PATCH] fixing file submission

David Faure faure at kde.org
Fri Oct 29 11:06:57 BST 2004


On Friday 29 October 2004 06:43, George Staikos wrote:
> 
> There are all kinds of weird quirks with KURLRequester in apps, and KHTML 
> experiences these problems in multiple ways.  I think this patch fixes it.  
> It does the following:
> 
> 1) make the completion in KURLRequester relative to $PWD, which I think makes 
> sense

Well the $PWD is a notion that doesn't really apply to GUIs - especially those
which don't show local directories (i.e. filemanagers do have a $PWD, but not webbrowsers).
How do you see the $PWD in konq-as-browser? How do you change it?

I'd rather make the completion relative to a fixed dir (e.g. KGlobalSettings::documentPath())

> 2) work with relative filenames, absolute filenames, and URLs

Looks good. 

A small simplification:
+            if (QFile::exists(val) && QFileInfo(val).isRelative()) {
+                fileurl = KURL::fromPathOrURL(QFileInfo(val).absFilePath());
could be made
+            if (QFile::exists(val) && QFileInfo(val).isRelative()) {
+                 fileurl.setPath( QFileInfo(val).absFilePath() );
since it's clear it's a path and not a URL in this case.


-        case FILE:
+       case FILE: // hmm, we have the type FILE also.  bad choice here...
Hmm?

-- 
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 kfm-devel mailing list