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) self.new_item(self._bookmark_cat, url, title)
def custom_filter(self, pattern, row, parent): def custom_filter(self, pattern, row, parent):
"""Filter by url and title. """Filter by url and title."""
"""
index0 = self.index(row, 0, parent) index0 = self.index(row, 0, parent)
index1 = self.index(row, 1, parent) index1 = self.index(row, 1, parent)
url = self.data(index0) or '' url = self.data(index0) or ''

View File

@ -211,14 +211,14 @@ class Command(misc.MinimalLineEditMixin, misc.CommandLineEdit):
e.ignore() e.ignore()
return return
else: 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() self.delete_current_item()
else: else:
super().keyPressEvent(e) super().keyPressEvent(e)
def delete_current_item(self): def delete_current_item(self):
completer_obj = objreg.get('completer', scope='window', """Delete the selected bookmark/quickmark."""
window=self._win_id)
completion = objreg.get('completion', scope='window', completion = objreg.get('completion', scope='window',
window=self._win_id) window=self._win_id)
index = completion.currentIndex() index = completion.currentIndex()
@ -232,7 +232,8 @@ class Command(misc.MinimalLineEditMixin, misc.CommandLineEdit):
message.info(self._win_id, "Bookmarks deleted") message.info(self._win_id, "Bookmarks deleted")
elif category.data() == 'Quickmarks': elif category.data() == 'Quickmarks':
quickmark_manager = objreg.get('quickmark-manager') 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) quickmark_manager.quickmark_del(name)
message.info(self._win_id, "Quickmarks deleted") message.info(self._win_id, "Quickmarks deleted")