Simplify delete_cur_item for UrlCompletionModel.
This commit is contained in:
parent
08fe1d59e6
commit
d9d68db5df
@ -150,10 +150,11 @@ class UrlCompletionModel(base.BaseCompletionModel):
|
||||
completion: The Completion object to use.
|
||||
"""
|
||||
index = completion.currentIndex()
|
||||
model = completion.model()
|
||||
url = model.data(index)
|
||||
qtutils.ensure_valid(index)
|
||||
url = index.data()
|
||||
category = index.parent()
|
||||
if category.isValid():
|
||||
qtutils.ensure_valid(category)
|
||||
|
||||
if category.data() == 'Bookmarks':
|
||||
bookmark_manager = objreg.get('bookmark-manager')
|
||||
bookmark_manager.delete(url)
|
||||
|
Loading…
Reference in New Issue
Block a user