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.
|
completion: The Completion object to use.
|
||||||
"""
|
"""
|
||||||
index = completion.currentIndex()
|
index = completion.currentIndex()
|
||||||
model = completion.model()
|
qtutils.ensure_valid(index)
|
||||||
url = model.data(index)
|
url = index.data()
|
||||||
category = index.parent()
|
category = index.parent()
|
||||||
if category.isValid():
|
qtutils.ensure_valid(category)
|
||||||
|
|
||||||
if category.data() == 'Bookmarks':
|
if category.data() == 'Bookmarks':
|
||||||
bookmark_manager = objreg.get('bookmark-manager')
|
bookmark_manager = objreg.get('bookmark-manager')
|
||||||
bookmark_manager.delete(url)
|
bookmark_manager.delete(url)
|
||||||
|
Loading…
Reference in New Issue
Block a user