summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mainwindow.cpp2
-rw-r--r--storemodel.cpp5
-rw-r--r--storemodel.h3
3 files changed, 7 insertions, 3 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp
index 05b2bfe9..8882aca8 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -90,7 +90,7 @@ void MainWindow::checkConfig() {
model.setNameFilterDisables(false);
proxyModel.setSourceModel(&model);
- proxyModel.setFSModel(&model);
+ proxyModel.setModelAndStore(&model, passStore);
selectionModel = new QItemSelectionModel(&proxyModel);
model.fetchMore(model.setRootPath(passStore));
model.sort(0, Qt::AscendingOrder);
diff --git a/storemodel.cpp b/storemodel.cpp
index f7c7b8c2..7e889d3f 100644
--- a/storemodel.cpp
+++ b/storemodel.cpp
@@ -48,6 +48,8 @@ bool StoreModel::ShowThis(const QModelIndex index) const
{
QModelIndex useIndex = sourceModel()->index(index.row(), 0, index.parent());
QString path = fs->filePath(useIndex);
+ path.replace(".gpg", "");
+ path.replace(store, "");
if ( ! path.contains(filterRegExp()))
{
retVal = false;
@@ -60,6 +62,7 @@ bool StoreModel::ShowThis(const QModelIndex index) const
return retVal;
}
-void StoreModel::setFSModel(QFileSystemModel *sourceModel) {
+void StoreModel::setModelAndStore(QFileSystemModel *sourceModel, QString passStore) {
fs = sourceModel;
+ store = passStore;
}
diff --git a/storemodel.h b/storemodel.h
index e503a1ce..cad3c8de 100644
--- a/storemodel.h
+++ b/storemodel.h
@@ -9,13 +9,14 @@ class StoreModel : public QSortFilterProxyModel
Q_OBJECT
private:
QFileSystemModel* fs;
+ QString store;
public:
StoreModel();
bool filterAcceptsRow(int, const QModelIndex &) const;
bool ShowThis(const QModelIndex) const;
- void setFSModel(QFileSystemModel *sourceModel);
+ void setModelAndStore(QFileSystemModel *sourceModel, QString passStore);
};
#endif // STOREMODEL_H