summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaciej S. Szmigiero <mail@maciej.szmigiero.name>2019-09-21 16:36:22 +0200
committerMaciej S. Szmigiero <mail@maciej.szmigiero.name>2019-09-21 17:31:08 +0200
commitdd1411d87b4707b544fcc22ad4b35aaa41301193 (patch)
tree28141c73e78347566070e3d7e63b4d4f8ae61156
parentf9f9fba7ebad4f7fee7516f562d7bf9aa41dd703 (diff)
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.
-rw-r--r--src/mainwindow.cpp1
-rw-r--r--src/storemodel.cpp1
2 files changed, 1 insertions, 1 deletions
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);
}