Remove quickmark_del and bookmark_del from the urlmark classes (use delete instead)
This commit is contained in:
parent
e9660ad676
commit
cba25d2bbb
@ -1116,7 +1116,10 @@ class CommandDispatcher:
|
|||||||
urlutils.invalid_url_error(self._win_id, url,
|
urlutils.invalid_url_error(self._win_id, url,
|
||||||
"delete quickmark")
|
"delete quickmark")
|
||||||
return
|
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')
|
@cmdutils.register(instance='command-dispatcher', scope='window')
|
||||||
def bookmark_add(self, url=None, title=None):
|
def bookmark_add(self, url=None, title=None):
|
||||||
@ -1183,7 +1186,11 @@ class CommandDispatcher:
|
|||||||
if url is None:
|
if url is None:
|
||||||
url = self._current_url().toString(QUrl.RemovePassword
|
url = self._current_url().toString(QUrl.RemovePassword
|
||||||
| QUrl.FullyEncoded)
|
| 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,
|
@cmdutils.register(instance='command-dispatcher', hide=True,
|
||||||
scope='window')
|
scope='window')
|
||||||
|
@ -204,17 +204,6 @@ class QuickmarkManager(UrlMarkManager):
|
|||||||
else:
|
else:
|
||||||
set_mark()
|
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):
|
def get_by_qurl(self, url):
|
||||||
"""Look up a quickmark by QUrl, returning its name.
|
"""Look up a quickmark by QUrl, returning its name.
|
||||||
|
|
||||||
@ -299,14 +288,3 @@ class BookmarkManager(UrlMarkManager):
|
|||||||
self.marks[urlstr] = title
|
self.marks[urlstr] = title
|
||||||
self.changed.emit()
|
self.changed.emit()
|
||||||
self.added.emit(title, urlstr)
|
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))
|
|
||||||
|
Loading…
Reference in New Issue
Block a user