QtPass  1.2.3
Multi-platform GUI for pass, the standard unix password manager.
Go to the documentation of this file.
1 #ifndef STOREMODEL_H_
2 #define STOREMODEL_H_
4 #include "util.h"
5 #include <QSortFilterProxyModel>
11 class QFileSystemModel;
12 class StoreModel : public QSortFilterProxyModel {
15 private:
16  QFileSystemModel *fs;
17  QString store;
19 public:
20  StoreModel();
22  bool filterAcceptsRow(int, const QModelIndex &) const;
23  bool ShowThis(const QModelIndex) const;
24  void setModelAndStore(QFileSystemModel *sourceModel, QString passStore);
25  QVariant data(const QModelIndex &index, int role) const;
27  // QAbstractItemModel interface
28 public:
29  Qt::DropActions supportedDropActions() const;
30  Qt::DropActions supportedDragActions() const;
31  Qt::ItemFlags flags(const QModelIndex &index) const;
32  QStringList mimeTypes() const;
33  QMimeData *mimeData(const QModelIndexList &indexes) const;
34  bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row,
35  int column, const QModelIndex &parent) const;
36  bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row,
37  int column, const QModelIndex &parent);
38 };
45  bool isDir;
46  bool isFile;
47  QString path;
48 };
50 #endif // STOREMODEL_H_
bool ShowThis(const QModelIndex) const
StoreModel::ShowThis should a row be shown, based on our search criteria.
Definition: storemodel.cpp:52
Qt::DropActions supportedDragActions() const
StoreModel::supportedDragActions enable drag.
Definition: storemodel.cpp:120
QMimeData * mimeData(const QModelIndexList &indexes) const
Definition: storemodel.cpp:139
bool filterAcceptsRow(int, const QModelIndex &) const
StoreModel::filterAcceptsRow should row be shown, wrapper for StoreModel::ShowThis method.
Definition: storemodel.cpp:40
Qt::DropActions supportedDropActions() const
StoreModel::supportedDropActions enable drop.
Definition: storemodel.cpp:113
bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const
Definition: storemodel.cpp:161
void setModelAndStore(QFileSystemModel *sourceModel, QString passStore)
StoreModel::setModelAndStore update the source model and store.
Definition: storemodel.cpp:81
Qt::ItemFlags flags(const QModelIndex &index) const
Definition: storemodel.cpp:124
The QSortFilterProxyModel for handling filesystem searches.
Definition: storemodel.h:12
QVariant data(const QModelIndex &index, int role) const
StoreModel::data don't show the .gpg at the end of a file.
Definition: storemodel.cpp:93
QStringList mimeTypes() const
Definition: storemodel.cpp:133
StoreModel::StoreModel SubClass of QSortFilterProxyModel via http://www.qtcentre.org/threads/46471-QT...
Definition: storemodel.cpp:31
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
Definition: storemodel.cpp:201