Bug 408939 - disallow duplicate bookmarks
Summary: disallow duplicate bookmarks
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: bookmark (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords: junior-jobs, usability
Depends on:
Blocks:
 
Reported: 2019-06-20 05:02 UTC by Teemu Rytilahti
Modified: 2019-08-24 19:29 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 19.12


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Teemu Rytilahti 2019-06-20 05:02:12 UTC
SUMMARY
Konsole should not allow creating duplicate bookmarks.
For my personal setup I have chosen ctrl+shift+n instead of the default ctrl+shift+t to open a new tab, and as I was scrolling over the menus for other reasons, I noticed that I have tens of bookmarks pointing to my $HOME.

STEPS TO REPRODUCE
1. Keep pressing ctrl+shift+b for ten seconds or so, or
2. Press ctrl+shift+b accidentally every now and then

OBSERVED RESULT
The bookmarks menu is filled with loads of bookmarks, lots pointing to the same location

EXPECTED RESULT
Bookmarking will be ignored when there is already an existing bookmark for the path.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2019-06-21 09:37:22 UTC
Heh, I also have a ton of duplicate bookmarks.
Comment 3 Kurt Hindenburg 2019-08-24 19:14:30 UTC
Git commit befaaa0255b2e620753a6a119268515d4b0b8413 by Kurt Hindenburg, on behalf of Martin T. H. Sandsmark.
Committed on 24/08/2019 at 19:12.
Pushed by hindenburg into branch 'master'.

Do not allow adding duplicates in bookmarks

This currently only catches bookmarks in top-level (ie not sub-folders)

Original code by Tomaz Canabrava <tcanabrava@kde.org>
FIXED-IN: 19.12

https://invent.kde.org/kde/konsole/merge_requests/8

M  +4    -5    src/BookmarkHandler.cpp
M  +0    -2    src/BookmarkHandler.h
A  +54   -0    src/BookmarkMenu.cpp     [License: LGPL]
A  +48   -0    src/BookmarkMenu.h     [License: LGPL]
M  +1    -0    src/CMakeLists.txt

https://invent.kde.org/kde/konsole/commit/befaaa0255b2e620753a6a119268515d4b0b8413
Comment 4 Kurt Hindenburg 2019-08-24 19:14:33 UTC
Git commit befaaa0255b2e620753a6a119268515d4b0b8413 by Kurt Hindenburg, on behalf of Martin T. H. Sandsmark.
Committed on 24/08/2019 at 19:12.
Pushed by scmsync into branch 'master'.

Do not allow adding duplicates in bookmarks

This currently only catches bookmarks in top-level (ie not sub-folders)

Original code by Tomaz Canabrava <tcanabrava@kde.org>
FIXED-IN: 19.12

https://invent.kde.org/kde/konsole/merge_requests/8

M  +4    -5    src/BookmarkHandler.cpp
M  +0    -2    src/BookmarkHandler.h
A  +54   -0    src/BookmarkMenu.cpp     [License: LGPL]
A  +48   -0    src/BookmarkMenu.h     [License: LGPL]
M  +1    -0    src/CMakeLists.txt

https://commits.kde.org/konsole/befaaa0255b2e620753a6a119268515d4b0b8413
Comment 5 Kurt Hindenburg 2019-08-24 19:25:17 UTC
Do you think Konsole should try to add a menu option to "Remove duplicate bookmarks"?
Comment 6 Nate Graham 2019-08-24 19:26:52 UTC
Maybe it should just auto-remove them in the next release.
Comment 7 Teemu Rytilahti 2019-08-24 19:29:56 UTC
Thanks a lot for such a quick turnaround!

(In reply to Kurt Hindenburg from comment #5)
> Do you think Konsole should try to add a menu option to "Remove duplicate
> bookmarks"?

I don't think it's necessary to add more code that needs to be maintained. In case such feature is wanted, I think a better way would be to extend the DBUS interface of KBookmarkManager to allow removal of bookmarks. Then it would be fairly simple to create a script to do that (as I suppose removal of existing duplicates will be more or less a single shot procedure anyway).