Bug 85925 - Option to use folder name - not complete adress - as window title
Summary: Option to use folder name - not complete adress - as window title
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: general (other bugs)
Version First Reported In: 3.2.2
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konqueror Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-25 12:14 UTC by Christoph Wiesen
Modified: 2004-08-16 23:40 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Wiesen 2004-07-25 12:14:39 UTC
Version:           3.2.2 (using KDE 3.2.3,  (testing/unstable))
Compiler:          gcc version 3.3.3 (Debian 20040422)
OS:                Linux (i686) release 2.6.7

With several Konqueror (file management) windows open it's sometimes very frustrating and time consuming to find the one you're looking for.
Because maybe you're browsing several directories below /home/chris to move and copy files every open Konqueror window is named like file:/home/chris/...
So you can't differentiate between "file:/home/chris/Music/" "file:/home/chris/Videos/" and "file:/home/chris/Download/" just with a glance at Kicker.
I hope something could be done about this - if there already is an option I failed to find it.

To fix this this the simplest solution would be to make the window naming of Konqueror (File Manager) the same as in... Konqueror (Web-Browser).

The page I'm currently at for example is:
http://bugs.kde.org/wizard.cgi
And Konqueror's Window Title - and thus the Kicker Bar - is the page's name: "Bug Entry Form". I can easily find the window that says "Bug En" in Kicker (I have many windows open so it's rather small - but enough).

Please make an option for file-browsing to have the window title show _only_ the name of the current directory.

So "file:/home/chris/Videos/" would show "Videos" and "file:/home/chris/Downloads/" would show "Downloads" in Kicker.
Comment 1 Christoph Wiesen 2004-07-25 12:23:01 UTC
I hope I've explained this well enough, but just to be sure. If you now try to open several Konqueror windows and browse to a subdirectory of /home/<username>/ you'll probably be just fine and get all the information you need from a glance at Kicker if you don't have many other windows open.
Of course there are deeper hierarchies and directory structures that could be browsed and are just to long to be shown to their fullest inside the Kicker bars - especially with the "file:/" prefixes.

So this depends very much on the resolution / font-size in use and the number of open windows. But unless you're _very_ strict with closing 'unneeded' windows or have all your files no deeper than one directory below ~/ you've probably had this issue before too.
Hope I explained it well enough :)
Comment 2 Sebastien 2004-07-25 22:47:18 UTC
You have my vote (me too I have a loooot of openned windows).
Therefor, at university my home directory is:
  file:/home/public/info/info1/grp2.1/slaout/
In this context, I would prefer to show "~/" instead of the very complexe path.
And since no lambda user should access files outside of the home directory, they should know what means "~/" (and eventually "/"). I'm for shortcuting every "nice displayable" paths like this.
In this context, even "/home/<username>/Download" could be shorten to "~/Download" (*eventually*).
Because I create some directories in my home dir (with nice icons), I'm rarly deeper than one (or two) sub-dir from the Home.
Comment 3 jamethknorth 2004-07-26 05:36:26 UTC
It would likely be better to show as much of the path as possible, including the last element, not just the last element. Thus, "/mnt/cdrom/Documents" might shorten to "...drom/Documents". Often the directory above the final one is also very useful information.
Comment 4 Christoph Wiesen 2004-07-26 14:57:05 UTC
I'm not sure but I doubt that it's possible to re-calculate the title of every Konqueror window when the kicker bars get shorter (e.g. when more windows are opened). If there is a way to separate the window title and what is shown on the kicker bars that would be nice, yes. But I think it would look awkward to have window titles change from ...cdrom/Documents to ...om/Documents just because you opened more windows.

Even though I think most "normal" users would benefit from a behavior as explained above (current folder name _only_) and it might thus make a good default I won't argue that more information is a good think - so maybe make it just an _option_.
Comment 5 jamethknorth 2004-07-26 19:01:44 UTC
It can be recalculated, as it is recalculated currently. The title is cut off in the kicker panel, it is just cut-off in the reverse direction of what I suggestion (truncates leaving thing beginning rather than the end).

Although the title will change marginally when those bars shrink in size, they will be more useful when it is larger. That is definitely a trade-off that needs to be considered. If it only showed "Documents" ever, it could be very misleading. In my example, it was a "Documents" folder on a cdrom, but just the word "Documents" would more likely be "~/Documents". The levels above the final level are useful information.
Comment 6 Sebastien 2004-07-29 13:12:17 UTC
> It can be recalculated, as it is recalculated currently.
> The title is cut off in the kicker panel, it is just
> cut-off in the reverse direction of what I suggestion
> (truncates leaving thing beginning rather than the end).

I don't think it would work.
You will have title like [..onqueror] :-)
More generally, the name of the app, which is worst.

But, you can explicitly produce a code that will take care of it and will align right the path, excluding the app name, which will be shown only if the path is smaller than the button.

A bit overloaded solution !
And I'm not sure it would work for every apps, or will be consistent/needed for all apps.
Comment 7 Waldo Bastian 2004-07-31 18:16:35 UTC
CVS commit by waba: 

Use folder name instead of complete URL as window title for local URLs
(BR85925)
Based on patch by David Sansome
CCMAIL: 85925-done@bugs.kde.org


  M +13 -2     konq_mainwindow.cc   1.1341


--- kdebase/konqueror/konq_mainwindow.cc  #1.1340:1.1341
@@ -4052,7 +4052,18 @@ void KonqMainWindow::setCaption( const Q
   {
     kdDebug(1202) << "KonqMainWindow::setCaption(" << caption << ")" << endl;
+    
+    QString adjustedCaption = caption;
+    // For local URLs we prefer to use only the directory name
+    if (m_currentView->url().isLocalFile())
+    {
+       // Is the caption a URL?  If so, is it local?  If so, only display the filename!
+       KURL url(caption);
+       if (url.isValid() && url.isLocalFile())
+          adjustedCaption = url.fileName();
+    }
+    
     // Keep an unmodified copy of the caption (before kapp->makeStdCaption is applied)
-    m_currentView->setCaption( caption );
-    KParts::MainWindow::setCaption( caption );
+    m_currentView->setCaption( adjustedCaption );
+    KParts::MainWindow::setCaption( adjustedCaption );
   }
 }


Comment 8 Christoph Wiesen 2004-08-16 23:40:10 UTC
I'm using Debian unstalbe's version of KDE 3.3 right now and even though the patch works nicely most of the time I have just discovered that the window title and thus the taskbar title somtimes remains unchanged even if I already changed to another direction - it dosen't get updated then anymore. Not with changing the directory again, not with reload.
Problem is I can't point my finger on when this is happening, but I've had this twice now within some minutes - probably just didn't notice before.

One thing:
The icon shown was not the one corresponding to the window title (wrong directory) but it was the one of the real directory konqueror showed at that moment... maybe this helps a bit. I'm not sure, but could someone check if there is some situation the alogirthm would not update the window title?

I'm not re-opening the bug because I'm uncertain as to what this would mean - I hope everyone involved receives an email anyway.