Skip to content

[Notifications] Display URL relative to Place similar to KUrlNavigator

Kai Uwe Broulik requested to merge work/notifications-places-url into master

This changes the displayed destination of a file operation in the summary to be relative to the closest user's place, similar to how the KUrlNavigator (address bar) does it in Dolphin, for example:

Especially for remote locations the user has bookmarked this can tremendously clean up the displayed address, showing a nice name rather than the full URL.

The other logic about showing local paths and replacement of $HOME by tilde has been removed as both Root and Home are default places that are likely to be present.


@dfaure

URL Before After
file:///tmp /tmp Root/tmp
file:///home/kbroulik Home Home
file:///home/kbroulik/Test ~/test Home/test
file:///home/kbroulik/Documents Documents Documents
file:///home/kbroulik/Documents/KDE ~/Documents/KDE Documents/KDE
file:///home/kbroulik/Projects/kf5/plasma-workspace ~/Projects/kf5/plasma-workspace kf5/plasma-workspace (I have my kf5 folder bookmarked)
sftp:///kbroulik-desktop.local/home/kbroulik sftp:///kbroulik-desktop.local/home/kbroulik kbroulik-desktop (I have that bookmarked as such)
sftp:///kbroulik-desktop.local/home/kbroulik/Projects/kf5/plasma-workspace sftp:///kbroulik-desktop.local/home/kbroulik/Projects/kf5/plasma-workspace kbroulik-desktop/kf5/pasma-workspace

Merge request reports

Loading