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