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
PIM Messagelib
Commits
822570fa
Commit
822570fa
authored
Jun 08, 2021
by
Laurent Montel
😁
Browse files
Save/load status filter
parent
5b0b1b6b
Pipeline
#64752
passed with stage
in 41 minutes and 9 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
messagelist/src/core/filter.cpp
View file @
822570fa
...
...
@@ -155,7 +155,12 @@ void Filter::save(const KSharedConfig::Ptr &config, const QString &filtername)
newGroup
.
writeEntry
(
"searchOptions"
,
static_cast
<
int
>
(
mOptions
));
newGroup
.
writeEntry
(
"tagId"
,
mTagId
);
newGroup
.
writeEntry
(
"identifier"
,
mIdentifier
);
// TODO mStatus.toQInt32()
QList
<
qint32
>
lst
;
lst
.
reserve
(
mStatus
.
count
());
for
(
const
auto
s
:
qAsConst
(
mStatus
))
{
lst
<<
s
.
toQInt32
();
}
newGroup
.
writeEntry
(
"status"
,
lst
);
newGroup
.
sync
();
grp
.
writeEntry
(
"NumberFilter"
,
numberFilter
);
grp
.
sync
();
...
...
@@ -179,6 +184,16 @@ Filter *Filter::loadFromConfigGroup(const KConfigGroup &newGroup)
filter
->
setTagId
(
newGroup
.
readEntry
(
"tagId"
));
filter
->
setIdentifier
(
newGroup
.
readEntry
(
"identifier"
));
filter
->
setFilterName
(
newGroup
.
readEntry
(
"name"
));
QList
<
qint32
>
lst
;
lst
=
newGroup
.
readEntry
(
"status"
,
QList
<
qint32
>
());
QVector
<
Akonadi
::
MessageStatus
>
messageStatusLst
;
messageStatusLst
.
reserve
(
lst
.
count
());
for
(
const
auto
s
:
qAsConst
(
lst
))
{
Akonadi
::
MessageStatus
status
;
status
.
fromQInt32
(
s
);
messageStatusLst
<<
status
;
}
filter
->
setStatus
(
messageStatusLst
);
filter
->
setOptions
(
static_cast
<
QuickSearchLine
::
SearchOptions
>
(
newGroup
.
readEntry
(
"searchOptions"
).
toInt
()));
return
filter
;
}
...
...
Write
Preview
Markdown
is supported
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