QtPass 1.4.0
Multi-platform GUI for pass, the standard unix password manager.
Loading...
Searching...
No Matches
storemodel.h
Go to the documentation of this file.
1#ifndef STOREMODEL_H_
2#define STOREMODEL_H_
3
4#include <QSortFilterProxyModel>
5
10class QFileSystemModel;
11class StoreModel : public QSortFilterProxyModel {
12 Q_OBJECT
13
14private:
15 QFileSystemModel *fs;
16 QString store;
17
18public:
19 StoreModel();
20
21 bool filterAcceptsRow(int, const QModelIndex &) const override;
22 bool ShowThis(const QModelIndex) const;
23 void setModelAndStore(QFileSystemModel *sourceModel, QString passStore);
24 QVariant data(const QModelIndex &index, int role) const override;
25 bool lessThan(const QModelIndex &source_left,
26 const QModelIndex &source_right) const override;
27
28 // QAbstractItemModel interface
29public:
30 Qt::DropActions supportedDropActions() const override;
31 Qt::DropActions supportedDragActions() const override;
32 Qt::ItemFlags flags(const QModelIndex &index) const override;
33 QStringList mimeTypes() const override;
34 QMimeData *mimeData(const QModelIndexList &indexes) const override;
35 bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row,
36 int column, const QModelIndex &parent) const override;
37 bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row,
38 int column, const QModelIndex &parent) override;
39};
46 bool isDir;
47 bool isFile;
48 QString path;
49};
50
51#endif // STOREMODEL_H_
The QSortFilterProxyModel for handling filesystem searches.
Definition: storemodel.h:11
Qt::DropActions supportedDropActions() const override
StoreModel::supportedDropActions enable drop.
Definition: storemodel.cpp:117
QStringList mimeTypes() const override
StoreModel::mimeTypes.
Definition: storemodel.cpp:147
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
StoreModel::dropMimeData.
Definition: storemodel.cpp:238
StoreModel()
StoreModel::StoreModel SubClass of QSortFilterProxyModel via http://www.qtcentre.org/threads/46471-QT...
Definition: storemodel.cpp:34
bool filterAcceptsRow(int, const QModelIndex &) const override
StoreModel::filterAcceptsRow should row be shown, wrapper for StoreModel::ShowThis method.
Definition: storemodel.cpp:43
Qt::DropActions supportedDragActions() const override
StoreModel::supportedDragActions enable drag.
Definition: storemodel.cpp:125
QMimeData * mimeData(const QModelIndexList &indexes) const override
StoreModel::mimeData.
Definition: storemodel.cpp:158
bool ShowThis(const QModelIndex) const
StoreModel::ShowThis should a row be shown, based on our search criteria.
Definition: storemodel.cpp:55
bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override
StoreModel::lessThan.
Definition: storemodel.cpp:300
bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const override
StoreModel::canDropMimeData.
Definition: storemodel.cpp:189
QVariant data(const QModelIndex &index, int role) const override
StoreModel::data don't show the .gpg at the end of a file.
Definition: storemodel.cpp:97
void setModelAndStore(QFileSystemModel *sourceModel, QString passStore)
StoreModel::setModelAndStore update the source model and store.
Definition: storemodel.cpp:84
Qt::ItemFlags flags(const QModelIndex &index) const override
StoreModel::flags.
Definition: storemodel.cpp:134