Bug 55335

Summary: Use ~ in bookmark name
Product: [Applications] konsole Reporter: Philippe Fremy <phil>
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED FIXED    
Severity: wishlist    
Priority: NOR    
Version: 1.2   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:

Description Philippe Fremy 2003-02-28 10:32:54 UTC
Version:           1.2 (using KDE 3.1.0)
Installed from:    Gentoo
Compiler:          gcc version 3.2.1 20021207 (Gentoo Linux 3.2.1-20021207)
OS:          Linux (i686) release 2.4.19-gentoo-r9

When bookmarks in konsole, I can not see the whole path because the path is quite long. Using ~ instead of '/home/philippe' would make the name shorter.

Is the 'file:' really useful too ? I think you could replace the whole 'file:/home/philippe' by something like '~' or if you want to be more explicit 'HOME'.
Comment 1 Waldo Bastian 2003-02-28 11:14:36 UTC
Subject: KDE_3_1_BRANCH: kdebase/konsole/konsole

CVS commit by waba: 

Strip file: and replace homedir with ~ in bookmark title.
CCMAIL: 55335-done@bugs.kde.org


  M +15 -0     konsolebookmarkhandler.cpp   1.9.2.1
  M +1 -0      konsolebookmarkhandler.h   1.5.2.1


--- kdebase/konsole/konsole/konsolebookmarkhandler.cpp  #1.9:1.9.2.1
@@ -4,4 +4,5 @@
 #include <stdlib.h>
 
+#include <qdir.h>
 #include <qtextstream.h>
 
@@ -55,4 +56,18 @@ QString KonsoleBookmarkHandler::currentU
 {
     return m_konsole->baseURL().prettyURL();
+}
+
+QString KonsoleBookmarkHandler::currentTitle() const
+{
+    const KURL &u = m_konsole->baseURL();
+    if (u.isLocalFile())
+    {
+       QString path = u.path();
+       QString home = QDir::homeDirPath();
+       if (path.startsWith(home))
+          path.replace(0, home.length(), "~");
+       return path;
+    }
+    return u.prettyURL();
 }
 

--- kdebase/konsole/konsole/konsolebookmarkhandler.h  #1.5:1.5.2.1
@@ -24,4 +24,5 @@ public:
                                 { emit openURL( url, title ); }
     virtual QString currentURL() const;
+    virtual QString currentTitle() const;
 
     KPopupMenu *menu() const { return m_menu; }


Comment 2 Philippe Fremy 2003-02-28 15:04:01 UTC
Subject: Re:  Use ~ in bookmark name

he he, I wish all my bugs and wishes could be resolved as fast as this one

:-)