Commit 8f2b59f5 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Continue to implement model

parent d17edf9b
Pipeline #97826 passed with stage
in 14 minutes and 3 seconds
......@@ -29,14 +29,13 @@ QVariant CollectionSwitcherModel::data(const QModelIndex &index, int role) const
if (index.row() < 0 || index.row() >= mCollectionsInfo.count()) {
return {};
}
const CollectionInfo cat = mCollectionsInfo.at(index.row());
#if 0 // TODO implement it.
const CollectionInfo collectionInfo = mCollectionsInfo.at(index.row());
switch (role) {
case Name:
return cat.name();
case Category:
return cat.category();
case Qt::DisplayRole:
case CollectionFullPath:
return collectionInfo.mFullPath;
case CollectionAkonadId:
return collectionInfo.mNewCollection.id();
}
#endif
return {};
}
......@@ -13,6 +13,11 @@ class CollectionSwitcherModel : public QAbstractListModel
{
Q_OBJECT
public:
enum CollectionInfoRole {
CollectionFullPath = Qt::UserRole + 1,
CollectionAkonadId,
};
struct CollectionInfo {
const Akonadi::Collection mNewCollection;
QString mFullPath;
......
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