diff --git a/qutebrowser/completion/models/filepathcategory.py b/qutebrowser/completion/models/filepathcategory.py index c8e92a614..c026416bc 100644 --- a/qutebrowser/completion/models/filepathcategory.py +++ b/qutebrowser/completion/models/filepathcategory.py @@ -66,18 +66,14 @@ class FilePathCategory(QAbstractListModel): else: self._paths = [] - def data( - self, index: QModelIndex, role: int = Qt.DisplayRole - ) -> Optional[str]: + def data(self, index: QModelIndex, role: int = Qt.DisplayRole) -> Optional[str]: """Implement abstract method in QAbstractListModel.""" if role == Qt.DisplayRole and index.column() == 0: return self._paths[index.row()] - else: - return None + return None def rowCount(self, parent: QModelIndex = QModelIndex()) -> int: """Implement abstract method in QAbstractListModel.""" if parent.isValid(): return 0 - else: - return len(self._paths) + return len(self._paths) diff --git a/qutebrowser/completion/models/urlmodel.py b/qutebrowser/completion/models/urlmodel.py index 35cd9e156..5f7e8ebda 100644 --- a/qutebrowser/completion/models/urlmodel.py +++ b/qutebrowser/completion/models/urlmodel.py @@ -94,8 +94,7 @@ def url(*, info): models['history'] = hist_cat if 'filesystem' in categories: - models['filesystem'] = filepathcategory.FilePathCategory( - name='Filesystem') + models['filesystem'] = filepathcategory.FilePathCategory(name='Filesystem') for category in categories: if category in models: diff --git a/tests/unit/completion/test_models.py b/tests/unit/completion/test_models.py index b86eda979..d981caa9d 100644 --- a/tests/unit/completion/test_models.py +++ b/tests/unit/completion/test_models.py @@ -425,8 +425,8 @@ def test_filesystem_completion(qtmodeltester, config_stub, info, def test_default_filesystem_completion(qtmodeltester, config_stub, info, - web_history_populated, quickmarks, bookmarks, - local_files_path): + web_history_populated, quickmarks, bookmarks, + local_files_path): config_stub.val.completion.open_categories = ['filesystem'] config_stub.val.completion.favorite_paths = [str(local_files_path)] model = urlmodel.url(info=info)