Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KMail
Commits
8f2b59f5
Commit
8f2b59f5
authored
Nov 15, 2021
by
Laurent Montel
😁
Browse files
Continue to implement model
parent
d17edf9b
Pipeline
#97826
passed with stage
in 14 minutes and 3 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/historyswitchfolder/collectionswitchermodel.cpp
View file @
8f2b59f5
...
...
@@ -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
{};
}
src/historyswitchfolder/collectionswitchermodel.h
View file @
8f2b59f5
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment