From cba25d2bbb9fad8af3d0e3f3ceb949b68c21ea10 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sat, 23 Jul 2016 10:55:57 -0400 Subject: [PATCH] Remove quickmark_del and bookmark_del from the urlmark classes (use delete instead) --- qutebrowser/browser/commands.py | 11 +++++++++-- qutebrowser/browser/urlmarks.py | 22 ---------------------- 2 files changed, 9 insertions(+), 24 deletions(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 33e330cd1..064d555bf 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -1116,7 +1116,10 @@ class CommandDispatcher: urlutils.invalid_url_error(self._win_id, url, "delete quickmark") return - quickmark_manager.quickmark_del(name) + try: + quickmark_manager.delete(name) + except KeyError: + raise cmdexc.CommandError("Quickmark '{}' not found!".format(name)) @cmdutils.register(instance='command-dispatcher', scope='window') def bookmark_add(self, url=None, title=None): @@ -1183,7 +1186,11 @@ class CommandDispatcher: if url is None: url = self._current_url().toString(QUrl.RemovePassword | QUrl.FullyEncoded) - objreg.get('bookmark-manager').bookmark_del(url) + try: + objreg.get('bookmark-manager').delete(url) + except KeyError: + raise cmdexc.CommandError("Bookmark '{}' not found!".format(url)) + @cmdutils.register(instance='command-dispatcher', hide=True, scope='window') diff --git a/qutebrowser/browser/urlmarks.py b/qutebrowser/browser/urlmarks.py index 994d1f986..f8b011439 100644 --- a/qutebrowser/browser/urlmarks.py +++ b/qutebrowser/browser/urlmarks.py @@ -204,17 +204,6 @@ class QuickmarkManager(UrlMarkManager): else: set_mark() - def quickmark_del(self, name): - """Delete a quickmark. - - Args: - name: The name of the quickmark to delete. - """ - try: - self.delete(name) - except KeyError: - raise cmdexc.CommandError("Quickmark '{}' not found!".format(name)) - def get_by_qurl(self, url): """Look up a quickmark by QUrl, returning its name. @@ -299,14 +288,3 @@ class BookmarkManager(UrlMarkManager): self.marks[urlstr] = title self.changed.emit() self.added.emit(title, urlstr) - - def bookmark_del(self, url): - """Delete a bookmark. - - Args: - url: The URL of the bookmark to delete. - """ - try: - self.delete(url) - except KeyError: - raise cmdexc.CommandError("Bookmark '{}' not found!".format(url))