From dd1411d87b4707b544fcc22ad4b35aaa41301193 Mon Sep 17 00:00:00 2001 From: "Maciej S. Szmigiero" Date: Sat, 21 Sep 2019 16:36:22 +0200 Subject: Call setSourceModel() in StoreModel::setModelAndStore() When we are setting the source model in StoreModel::setModelAndStore() set it also for StoreModel base class to make the extra setSourceModel() call unnecessary. --- src/mainwindow.cpp | 1 - src/storemodel.cpp | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index c794a521..c643bcc5 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -65,7 +65,6 @@ MainWindow::MainWindow(const QString &searchText, QWidget *parent) QString passStore = QtPassSettings::getPassStore(Util::findPasswordStore()); - proxyModel.setSourceModel(&model); proxyModel.setModelAndStore(&model, passStore); // proxyModel.sort(0, Qt::AscendingOrder); selectionModel.reset(new QItemSelectionModel(&proxyModel)); diff --git a/src/storemodel.cpp b/src/storemodel.cpp index a46e1b03..b6fef94c 100644 --- a/src/storemodel.cpp +++ b/src/storemodel.cpp @@ -80,6 +80,7 @@ bool StoreModel::ShowThis(const QModelIndex index) const { */ void StoreModel::setModelAndStore(QFileSystemModel *sourceModel, QString passStore) { + setSourceModel(sourceModel); fs = sourceModel; store = std::move(passStore); } -- cgit v1.2.3