Fixed style.

This commit is contained in:
Antoni Boucher 2015-06-03 19:31:31 -04:00
parent f1874ff44f
commit 8b14145a4d
2 changed files with 7 additions and 7 deletions

View File

@ -99,8 +99,7 @@ class UrlCompletionModel(base.BaseCompletionModel):
self.new_item(self._bookmark_cat, url, title)
def custom_filter(self, pattern, row, parent):
"""Filter by url and title.
"""
"""Filter by url and title."""
index0 = self.index(row, 0, parent)
index1 = self.index(row, 1, parent)
url = self.data(index0) or ''

View File

@ -211,16 +211,16 @@ class Command(misc.MinimalLineEditMixin, misc.CommandLineEdit):
e.ignore()
return
else:
if e.key() == Qt.Key_D and e.modifiers() & Qt.ControlModifier == Qt.ControlModifier:
if e.key() == Qt.Key_D and (e.modifiers() & Qt.ControlModifier ==
Qt.ControlModifier):
self.delete_current_item()
else:
super().keyPressEvent(e)
def delete_current_item(self):
completer_obj = objreg.get('completer', scope='window',
window=self._win_id)
"""Delete the selected bookmark/quickmark."""
completion = objreg.get('completion', scope='window',
window=self._win_id)
window=self._win_id)
index = completion.currentIndex()
model = completion.model()
url = model.data(index)
@ -232,7 +232,8 @@ class Command(misc.MinimalLineEditMixin, misc.CommandLineEdit):
message.info(self._win_id, "Bookmarks deleted")
elif category.data() == 'Quickmarks':
quickmark_manager = objreg.get('quickmark-manager')
name = model.data(index.sibling(index.row(), index.column() + 1))
name = model.data(index.sibling(index.row(),
index.column() + 1))
quickmark_manager.quickmark_del(name)
message.info(self._win_id, "Quickmarks deleted")