QtPass  1.2.1
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 private:
15  QFileSystemModel *fs;
16  QString store;
17 
18 public:
19  StoreModel();
20 
21  bool filterAcceptsRow(int, const QModelIndex &) const;
22  bool ShowThis(const QModelIndex) const;
23  void setModelAndStore(QFileSystemModel *sourceModel, QString passStore);
24  QVariant data(const QModelIndex &index, int role) const;
25 
26  // QAbstractItemModel interface
27 public:
28  Qt::DropActions supportedDropActions() const;
29  Qt::DropActions supportedDragActions() const;
30  Qt::ItemFlags flags(const QModelIndex &index) const;
31  QStringList mimeTypes() const;
32  QMimeData *mimeData(const QModelIndexList &indexes) const;
33  bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row,
34  int column, const QModelIndex &parent) const;
35  bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row,
36  int column, const QModelIndex &parent);
37 };
44  bool isDir;
45  bool isFile;
46  QString path;
47 };
48 
49 #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:199