[CSE] Add FileIdRole for the FolderStatusModel

This way we can actually request the id from outside of the model.
This commit is contained in:
Tomaz Canabrava 2017-08-25 14:12:27 +02:00 committed by Roeland Jago Douma
parent 9870f39dcb
commit e2091bb0a3
No known key found for this signature in database
GPG key ID: F941078878347C0C
2 changed files with 4 additions and 0 deletions

View file

@ -163,6 +163,8 @@ QVariant FolderStatusModel::data(const QModelIndex &index, int role) const
return QColor(Qt::red); return QColor(Qt::red);
} }
break; break;
case FileIdRole:
return x._fileId;
case FolderStatusDelegate::FolderPathRole: { case FolderStatusDelegate::FolderPathRole: {
auto f = x._folder; auto f = x._folder;
if (!f) if (!f)

View file

@ -37,6 +37,8 @@ class FolderStatusModel : public QAbstractItemModel
{ {
Q_OBJECT Q_OBJECT
public: public:
enum {FileIdRole = Qt::UserRole+1};
FolderStatusModel(QObject *parent = 0); FolderStatusModel(QObject *parent = 0);
~FolderStatusModel(); ~FolderStatusModel();
void setAccountState(const AccountState *accountState); void setAccountState(const AccountState *accountState);