Prefer place name over actual name in title bar
ClosedPublic

Authored by broulik on Feb 27 2017, 4:32 PM.

Details

Summary

When inside a place, the address bar already gives it precedence over the actual folder name.
By doing this in the title bar also, we make it consistent and can mask ugly technical terminology like "trash:/" and instead show the nice localized "Trash" place name as well as "Home" instead of lowercase internal user name.

BUG: 211959

Test Plan
  • /home/foo: broulik → Persönlicher Ordner (Home)
  • /home/foo/Pictures: Pictures → Pictures (the place has the same name, coincidentally)
  • trash:/: trash - / → Papierkorb (Trash)
  • /: / → Basisordner (Root)
  • smb:/foo/bar: smb - foo - bar→ Foo (name of the place)
  • smb:/foo/bar/baz: smb - foo - baz → smb - foo - baz (unchanged, is no place)
  • /snap/core/1287/ 1287 → Loop Device (I need to fix Solid to just hide these)
  • timeline:/today/ timeline - today → timeline - today (the one in the places model doesn't have a trailing slash and thus place matching fails)

I explicitly opted not to show the scheme for places for the Trash and also if you explicitly made it a place, you probably knew (or don't even care) what it is technically using. A downside is when you have multiple similar devices (120 GiB removable drive) you cannot tell them apart from the address bar but you'd have a hard time in other places anyway.

Behavior of "Show full path in title bar" is unchanged, always showing the full address (e.g. /home/foo/bar, or smb - foo - /foo/bar)

Diff Detail

Repository
R318 Dolphin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Feb 27 2017, 4:32 PM
fabianr added a subscriber: fabianr.Mar 1 2017, 9:01 AM

I think that's a good change from UX point of view.

Regarding the test plan:
if

  • smb:/foo/bar: smb - foo - bar→ Foo (name of the place)

shouldn't this

  • smb:/foo/bar/baz: smb - foo - baz → smb - foo - baz (unchanged, is no place)

be

  • smb:/foo/bar: smb - foo - bar→ Foo - baz ?

At least that's what dolphin does in other places

emmanuelp requested changes to this revision.Mar 5 2017, 3:22 PM
emmanuelp added a subscriber: emmanuelp.

Nice feature :)

src/dolphinmainwindow.cpp
962

I think it would be better to create a new (static) places model instance instead of exposing (even more) implementation details of the view container. This would allow us to reuse this code for the tab titles (by moving it to global.h) without retouching the implementation.

This revision now requires changes to proceed.Mar 5 2017, 3:22 PM
broulik edited the summary of this revision. (Show Details)Mar 8 2017, 3:53 PM
broulik added inline comments.
src/dolphinmainwindow.cpp
962

Where should I put the static fileplacesmodel?

emmanuelp added inline comments.Mar 13 2017, 3:22 PM
src/dolphinmainwindow.cpp
962

Static local variable.

broulik updated this revision to Diff 18279.Aug 17 2017, 8:42 AM
broulik edited edge metadata.
  • Use static variable for KFilePlacesModel
Restricted Application added a subscriber: Konqueror. · View Herald TranscriptAug 17 2017, 8:42 AM
emmanuelp accepted this revision.Aug 25 2017, 6:09 PM

Nice work!

This revision is now accepted and ready to land.Aug 25 2017, 6:09 PM
dfaure added a subscriber: dfaure.Aug 27 2017, 7:15 PM

Is there a reason why Konqueror is added in CC of all dolphin merge requests? Is that done manually or automatically? I don't see the relevance for konqueror, especially for a patch for DolphinMainWindow (no effect on dolphinpart).

Is there a reason why Konqueror is added in CC of all dolphin merge requests? Is that done manually or automatically? I don't see the relevance for konqueror, especially for a patch for DolphinMainWindow (no effect on dolphinpart).

It is done automatically, I don't know who requested the rule; the reason is maybe the dolphinpart. Anyway, the rule was created last April and it says:

When all of these conditions are met:
Repository projects include any of Dolphin, Konqueror

Take these actions every time this rule matches:
Add subscribers: Dolphin, Konqueror.

The rule can be changed/tuned.

This revision was automatically updated to reflect the committed changes.