Bug 55335 - Use ~ in bookmark name
Summary: Use ~ in bookmark name
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 1.2
Platform: Gentoo Packages Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-28 10:32 UTC by Philippe Fremy
Modified: 2003-02-28 11:14 UTC (History)
0 users

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 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

:-)