Simplify delete_cur_item for UrlCompletionModel.

This commit is contained in:
Florian Bruhin 2015-07-29 12:44:38 +02:00
parent 08fe1d59e6
commit d9d68db5df

View File

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