Commit 517f2692 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Store collection

parent a97ea4c2
Pipeline #35346 failed with stage
in 105 minutes and 46 seconds
......@@ -39,3 +39,19 @@ Qt::ItemFlags FolderSettingFilterProxyModel::flags(const QModelIndex &index) con
return QSortFilterProxyModel::flags(index);
}
}
bool FolderSettingFilterProxyModel::setData(const QModelIndex &index, const QVariant &value, int role)
{
if (role == Qt::CheckStateRole) {
if (index.isValid()) {
const Akonadi::Collection collection
= data(index, Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>();
//mNotificationCollection[collection] = (value == Qt::Checked);
qDebug() << " collectionId " << collection.id();
Q_EMIT dataChanged(index, index);
//return true;
}
}
return QSortFilterProxyModel::setData(index, value, role);
}
......@@ -16,9 +16,10 @@ public:
explicit FolderSettingFilterProxyModel(QObject *parent = nullptr);
~FolderSettingFilterProxyModel();
QVariant data(const QModelIndex &index, int role) const override;
Q_REQUIRED_RESULT QVariant data(const QModelIndex &index, int role) const override;
bool setData(const QModelIndex &index, const QVariant &value, int role) override;
Qt::ItemFlags flags(const QModelIndex &index) const override;
Q_REQUIRED_RESULT Qt::ItemFlags flags(const QModelIndex &index) const override;
};
#endif // FOLDERSETTINGFILTERPROXYMODEL_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment