QtPass  1.2.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;
23  bool ShowThis(const QModelIndex) const;
24  void setModelAndStore(QFileSystemModel *sourceModel, QString passStore);
25  QVariant data(const QModelIndex &index, int role) const;
26 
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 };
49 
50 #endif // STOREMODEL_H_
bool ShowThis(const QModelIndex) const
StoreModel::ShowThis should a row be shown, based on our search criteria.
Definition: storemodel.cpp:51
Qt::DropActions supportedDragActions() const
StoreModel::supportedDragActions enable drag.
Definition: storemodel.cpp:119
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:39
Qt::DropActions supportedDropActions() const
StoreModel::supportedDropActions enable drop.
Definition: storemodel.cpp:112
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:80
Qt::ItemFlags flags(const QModelIndex &index) const
Definition: storemodel.cpp:123
The QSortFilterProxyModel for handling filesystem searches.
Definition: storemodel.h:12
QVariant data(const QModelIndex &index, int role) const
StoreModel::data don&#39;t show the .gpg at the end of a file.
Definition: storemodel.cpp:92
QStringList mimeTypes() const
Definition: storemodel.cpp:133
StoreModel()
StoreModel::StoreModel SubClass of QSortFilterProxyModel via http://www.qtcentre.org/threads/46471-QT...
Definition: storemodel.cpp:30
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
Definition: storemodel.cpp:202