QupZilla / qupzilla

Cross-platform Qt web browser
http://www.qupzilla.com
GNU General Public License v3.0
1.11k stars 350 forks source link

prevent duplicate bookmarks #2605

Closed tarptaeya closed 6 years ago

tarptaeya commented 6 years ago

context menu and drop url creates duplicate bookmarks if done more than once because there is no check if the bookmark already exists.

nowrep commented 6 years ago

I don't see a reason why to disallow multiple bookmarks with same url. Also the code calling this method (BookmarksModel::addBookmark) assumes that adding bookmark always succeeds, so this will break the assumption.

tarptaeya commented 6 years ago

It fills the space of bookmark toolbar with same bookmark otherwise

nowrep commented 6 years ago

There already is a warning that the url is bookmarked when creating new bookmark.

Martii commented 6 years ago

There already is a warning that the url is bookmarked when creating new bookmark.

There is? Just tried this with the address bar, and a context click with no visible warnings to my knowledge:

bookmarking end result

nowrep commented 6 years ago

Hmm I thought there is, but there really is not.

In that case a warning should be added to add bookmark dialog (BookmarksTools::addBookmarkDialog).

nowrep commented 6 years ago

This now lets the user modify the bookmark title / folder and only show warning messagebox right before actually storing the bookmark. That's just annoying and late (+ it leaks BookmarkItem in case of bookmark not being added).

What I had in mind with "warning" is to just show text in add bookmark dialog like (wording can be changed):

NOTE: This site is already bookmarked.

This label can be added eg. between folder combobox and dialog button box (ok/cancel buttons).

tarptaeya commented 6 years ago

Done, but I have preserved the BookmarksTools::allowDuplicateBookmarks for the case when dropping duplicate urls to bookmarks toolbar