Bug 117969 - In KDE File Dialog, URL's from Location History dropdown are inserted only partially
Summary: In KDE File Dialog, URL's from Location History dropdown are inserted only pa...
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: kfile (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Carsten Pfeiffer
URL:
Keywords:
: 133219 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-12-09 00:38 UTC by Andreas Schnaiter
Modified: 2006-09-02 20:30 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Schnaiter 2005-12-09 00:38:37 UTC
Version:            (using KDE KDE 3.5.0)
Installed from:    Compiled From Sources
Compiler:          gcc-3.3.6 
OS:                Linux

When opening a remote file in a KDE application using the 'Open File' dialog, 
and entering a URL like 
http://kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.14.3, 
the next time when selecting the URL from the Location history dropdown only the filename, in this case ChangeLog-2.6.14.3, gets inserted into the text field, so the dropdown is useless for remote URL's. This also applys to the 'Save File' Dialog.
Comment 1 Dominik Haumann 2006-09-02 16:48:51 UTC
*** Bug 133219 has been marked as a duplicate of this bug. ***
Comment 2 Andreas Kling 2006-09-02 16:51:30 UTC
SVN commit 580069 by kling:

When selecting a HTTP or HTTPS address from the "recent" files list,
keep it verbatim instead of splitting up in "path" and "filename".

BUG: 117969


 M  +6 -1      kfiledialog.cpp  


--- branches/KDE/3.5/kdelibs/kio/kfile/kfiledialog.cpp #580068:580069
@@ -1225,7 +1225,12 @@
         return;
     }
 
-//     #warning FIXME: http URLs, e.g. from KURLCombo
+    // FIXME: This should be done for all protocols that can be opened but
+    //        not "navigated"...
+    if (u.protocol() == "http" || u.protocol() == "https") {
+        locationEdit->lineEdit()->setEdited( true );
+        return;
+    }
 
     /* we strip the first / from the path to avoid file://usr which means
      *  / on host usr
Comment 3 Dominik Haumann 2006-09-02 17:42:18 UTC
SVN commit 580082 by dhaumann:

fix it in the right way (tm): honor protocols that do not support dir listing
CCBUG: 117969


 M  +1 -3      kfiledialog.cpp  


--- branches/KDE/3.5/kdelibs/kio/kfile/kfiledialog.cpp #580081:580082
@@ -1225,9 +1225,7 @@
         return;
     }
 
-    // FIXME: This should be done for all protocols that can be opened but
-    //        not "navigated"...
-    if (u.protocol() == "http" || u.protocol() == "https") {
+    if (!KProtocolInfo::supportsListing(u)) {
         locationEdit->lineEdit()->setEdited( true );
         return;
     }
Comment 4 Andreas Kling 2006-09-02 17:50:02 UTC
Thanks Dominik, you're a bucket of awesome!
Comment 5 Dominik Haumann 2006-09-02 19:43:36 UTC
SVN commit 580130 by dhaumann:

fix the right way: honor protocols that do not support directory listing.

I'm not 100% sure whether a call of
  locationEdit->lineEdit()->setModified(true);
right in front of the return is needed (I think not), so please review ;)
CCMAIL: coolo@kde.org

CCBUG: 117969


 M  +6 -11     kfiledialog.cpp  


--- trunk/KDE/kdelibs/kio/kfile/kfiledialog.cpp #580129:580130
@@ -1178,12 +1178,9 @@
         return;
     }
 
-    // FIXME: This should be done for all protocols that can be opened but
-    //        not "navigated"...
-    if (u.protocol() == "http" || u.protocol() == "https") {
-        locationEdit->lineEdit()->setEdited(true);
+    // Honor protocols that do not support directory listing
+    if (!KProtocolManager::supportsListing(u))
         return;
-    }
 
     /* we strip the first / from the path to avoid file://usr which means
      *  / on host usr
@@ -1201,12 +1198,10 @@
         QString filename = u.url();
         int sep = filename.lastIndexOf('/');
         if (sep >= 0) { // there is a / in it
-            if ( KProtocolManager::supportsListing( u )) {
-                KUrl dir(u);
-                dir.setQuery( QString() );
-                dir.setFileName( QString() );
-                setUrl(dir, true );
-            }
+            KUrl dir(u);
+            dir.setQuery( QString() );
+            dir.setFileName( QString() );
+            setUrl(dir, true );
 
             // filename must be decoded, or "name with space" would become
             // "name%20with%20space", so we use KUrl::fileName()
Comment 6 Stephan Kulow 2006-09-02 20:30:17 UTC
Am Samstag, 2. September 2006 19:43 schrieb Dominik Haumann:
> SVN commit 580130 by dhaumann:
>
> fix the right way: honor protocols that do not support directory listing.
>
> I'm not 100% sure whether a call of
>   locationEdit->lineEdit()->setModified(true);
> right in front of the return is needed (I think not), so please review ;)
> CCMAIL: coolo@kde.org
>

I'm afraid I have nothing to do with that code :)

Greetings, Stephan