QtPass  1.2.0-pre
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 <QDataStream>
6 #include <QFileSystemModel>
7 #include <QRegExp>
8 #include <QSortFilterProxyModel>
9 #include <QStringListModel>
10 #include <qtpasssettings.h>
16 class StoreModel : public QSortFilterProxyModel {
18 private:
19  QFileSystemModel *fs;
20  QString store;
22 public:
23  StoreModel();
25  bool filterAcceptsRow(int, const QModelIndex &) const;
26  bool ShowThis(const QModelIndex) const;
27  void setModelAndStore(QFileSystemModel *sourceModel, QString passStore);
28  QVariant data(const QModelIndex &index, int role) const;
30  // QAbstractItemModel interface
31 public:
32  Qt::DropActions supportedDropActions() const;
33  Qt::DropActions supportedDragActions() const;
34  Qt::ItemFlags flags(const QModelIndex &index) const;
35  QStringList mimeTypes() const;
36  QMimeData *mimeData(const QModelIndexList &indexes) const;
37  bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row,
38  int column, const QModelIndex &parent) const;
39  bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row,
40  int column, const QModelIndex &parent);
41 };
48  bool isDir;
49  bool isFile;
50  QString path;
51 };
53 #endif // STOREMODEL_H_
bool ShowThis(const QModelIndex) const
StoreModel::ShowThis should a row be shown, based on our search criteria.
Definition: storemodel.cpp:50
Qt::DropActions supportedDragActions() const
StoreModel::supportedDragActions enable drag.
Definition: storemodel.cpp:118
QMimeData * mimeData(const QModelIndexList &indexes) const
Definition: storemodel.cpp:138
bool filterAcceptsRow(int, const QModelIndex &) const
StoreModel::filterAcceptsRow should row be shown, wrapper for StoreModel::ShowThis method...
Definition: storemodel.cpp:38
Qt::DropActions supportedDropActions() const
StoreModel::supportedDropActions enable drop.
Definition: storemodel.cpp:111
bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const
Definition: storemodel.cpp:160
void setModelAndStore(QFileSystemModel *sourceModel, QString passStore)
StoreModel::setModelAndStore update the source model and store.
Definition: storemodel.cpp:79
Qt::ItemFlags flags(const QModelIndex &index) const
Definition: storemodel.cpp:122
The QSortFilterProxyModel for handling filesystem searches.
Definition: storemodel.h:16
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:91
QStringList mimeTypes() const
Definition: storemodel.cpp:132
StoreModel::StoreModel SubClass of QSortFilterProxyModel via http://www.qtcentre.org/threads/46471-QT...
Definition: storemodel.cpp:29
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
Definition: storemodel.cpp:196