QtPass  1.3.3
Multi-platform GUI for pass, the standard unix password manager.
storemodel.h
Go to the documentation of this file.
1 #ifndef STOREMODEL_H_
2 #define STOREMODEL_H_
3 
4 #include "util.h"
5 #include <QSortFilterProxyModel>
6 
11 class QFileSystemModel;
12 class StoreModel : public QSortFilterProxyModel {
13  Q_OBJECT
14 
15 private:
16  QFileSystemModel *fs;
17  QString store;
18 
19 public:
20  StoreModel();
21 
22  bool filterAcceptsRow(int, const QModelIndex &) const override;
23  bool ShowThis(const QModelIndex) const;
24  void setModelAndStore(QFileSystemModel *sourceModel, QString passStore);
25  QVariant data(const QModelIndex &index, int role) const override;
26  bool lessThan(const QModelIndex &source_left,
27  const QModelIndex &source_right) const override;
28 
29  // QAbstractItemModel interface
30 public:
31  Qt::DropActions supportedDropActions() const override;
32  Qt::DropActions supportedDragActions() const override;
33  Qt::ItemFlags flags(const QModelIndex &index) const override;
34  QStringList mimeTypes() const override;
35  QMimeData *mimeData(const QModelIndexList &indexes) const override;
36  bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row,
37  int column, const QModelIndex &parent) const override;
38  bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row,
39  int column, const QModelIndex &parent) override;
40 };
47  bool isDir;
48  bool isFile;
49  QString path;
50 };
51 
52 #endif // STOREMODEL_H_
dragAndDropInfoPasswordStore
Definition: storemodel.h:46
StoreModel::dropMimeData
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
StoreModel::dropMimeData.
Definition: storemodel.cpp:236
StoreModel::supportedDragActions
Qt::DropActions supportedDragActions() const override
StoreModel::supportedDragActions enable drag.
Definition: storemodel.cpp:123
StoreModel::mimeTypes
QStringList mimeTypes() const override
StoreModel::mimeTypes.
Definition: storemodel.cpp:145
StoreModel::ShowThis
bool ShowThis(const QModelIndex) const
StoreModel::ShowThis should a row be shown, based on our search criteria.
Definition: storemodel.cpp:53
dragAndDropInfoPasswordStore::path
QString path
Definition: storemodel.h:49
StoreModel::flags
Qt::ItemFlags flags(const QModelIndex &index) const override
StoreModel::flags.
Definition: storemodel.cpp:132
StoreModel::data
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:95
StoreModel
The QSortFilterProxyModel for handling filesystem searches.
Definition: storemodel.h:12
StoreModel::canDropMimeData
bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const override
StoreModel::canDropMimeData.
Definition: storemodel.cpp:187
StoreModel::supportedDropActions
Qt::DropActions supportedDropActions() const override
StoreModel::supportedDropActions enable drop.
Definition: storemodel.cpp:115
StoreModel::mimeData
QMimeData * mimeData(const QModelIndexList &indexes) const override
StoreModel::mimeData.
Definition: storemodel.cpp:156
StoreModel::setModelAndStore
void setModelAndStore(QFileSystemModel *sourceModel, QString passStore)
StoreModel::setModelAndStore update the source model and store.
Definition: storemodel.cpp:82
dragAndDropInfoPasswordStore::isFile
bool isFile
Definition: storemodel.h:48
dragAndDropInfoPasswordStore::isDir
bool isDir
Definition: storemodel.h:47
StoreModel::StoreModel
StoreModel()
StoreModel::StoreModel SubClass of QSortFilterProxyModel via http://www.qtcentre.org/threads/46471-QT...
Definition: storemodel.cpp:32
StoreModel::lessThan
bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override
StoreModel::lessThan.
Definition: storemodel.cpp:300
util.h
StoreModel::filterAcceptsRow
bool filterAcceptsRow(int, const QModelIndex &) const override
StoreModel::filterAcceptsRow should row be shown, wrapper for StoreModel::ShowThis method.
Definition: storemodel.cpp:41