Remove quickmark_del and bookmark_del from the urlmark classes (use delete instead)

This commit is contained in:
Marshall Lochbaum 2016-07-23 10:55:57 -04:00
parent e9660ad676
commit cba25d2bbb
2 changed files with 9 additions and 24 deletions

View File

@ -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')

View File

@ -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))