Bug 238094 - kdevelop 4 doesn't remember remote file URIs
Summary: kdevelop 4 doesn't remember remote file URIs
Status: RESOLVED FIXED
Alias: None
Product: kdevplatform
Classification: Developer tools
Component: project (other bugs)
Version First Reported In: 1.0.0
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: 1.0.1
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-18 22:28 UTC by Maciej Mrozowski
Modified: 2010-09-02 17:36 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Mrozowski 2010-05-18 22:28:51 UTC
Version:           4.0.0 (using KDE 4.4.3)
OS:                Linux
Installed from:    Gentoo Packages

Originally reported:
https://bugs.gentoo.org/show_bug.cgi?id=319625

Summary:

It is perfectly possible to open a file from a remote destination, say
ftp://joe@example.com/var/www/index.html. But when trying to open another file,
via "File -> Open..." kdevelop doesn't open ftp://joe@example.com/var/www/,
instead it would show /var/www/ in the location bar and show the contents of
the Home dir in the file browser.

Same happens when you start creating a new project and try to set a project
directory on a remote site; you would be able to select
ftp://joe@example.com/var/www/, but after the file browser dialog is closed,
the input field for the project home path only shows /var/www/.
Comment 1 Milian Wolff 2010-05-18 23:23:58 UTC
confirmed by niko, reassigning to proper component
Comment 2 Andreas Pakulat 2010-05-19 09:40:11 UTC
commit 2dcbfa0c9de95499902a2313d70ec4422b020770
Author: Andreas Pakulat <apaku@gmx.de>
Date:   Wed May 19 09:36:47 2010 +0200

    Use the complete url of the active document.
    
    Don't just use the directory, use the complete url of the active
    document and go up one step. This fixes the default-dir when working
    with remote url.
    
    BUG:238094

diff --git a/shell/documentcontroller.cpp b/shell/documentcontroller.cpp
index 2288972..6d9344f 100644
--- a/shell/documentcontroller.cpp
+++ b/shell/documentcontroller.cpp
@@ -176,7 +176,7 @@ struct DocumentControllerPrivate {
             KUrl dir;
             if( controller->activeDocument() )
             {
-                dir = KUrl( controller->activeDocument()->url().directory() );
+                dir = controller->activeDocument()->url().upUrl();
             }else
             {
                 dir = KGlobal::config()->group("Open File").readEntry( "Last Open File Directory", Core::self()->projectController()->projectsBaseDirectory() );
Comment 3 Maciej Mrozowski 2010-09-02 17:36:59 UTC
Just FYI, reporter of bug 245540 apparently disagree with this bug resolution. I suggest to reopen this one and mark the other as duplicate.