From 31eed6c9a6a90c8d302ca5abcd1da2000bd084d1 Mon Sep 17 00:00:00 2001 From: Antoni Boucher Date: Sun, 7 Jun 2015 20:16:45 -0400 Subject: [PATCH] Fixed to avoid having duplicate bookmarks. --- qutebrowser/browser/bookmarks.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/qutebrowser/browser/bookmarks.py b/qutebrowser/browser/bookmarks.py index 5d7cd7530..c982160f4 100644 --- a/qutebrowser/browser/bookmarks.py +++ b/qutebrowser/browser/bookmarks.py @@ -116,10 +116,13 @@ class BookmarkManager(QObject): message.error(win_id, "Can't set mark with empty URL!") return - self.bookmarks[urlstr] = title - self.changed.emit() - self.added.emit(title, urlstr) - message.info(win_id, "Bookmarks added") + if urlstr in self.bookmarks: + message.error(win_id, "Bookmark already exists!") + else: + self.bookmarks[urlstr] = title + self.changed.emit() + self.added.emit(title, urlstr) + message.info(win_id, "Bookmark added") def bookmark_del(self, url): """Delete a bookmark.