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
630c8111
Commit
630c8111
authored
Apr 30, 2021
by
Laurent Montel
😁
Browse files
Load filter
parent
6d361335
Pipeline
#60248
passed with stage
in 39 minutes and 51 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
messagelist/src/core/filter.cpp
View file @
630c8111
...
...
@@ -136,6 +136,23 @@ void Filter::save(const KSharedConfig::Ptr &config, const QString &filtername)
newGroup
.
writeEntry
(
"currentFolder"
,
mCurrentFolder
.
id
());
// TODO mStatus.toQInt32()
newGroup
.
sync
();
grp
.
writeEntry
(
"NumberFilter"
,
numberFilter
);
grp
.
sync
();
}
Filter
*
Filter
::
load
(
const
KSharedConfig
::
Ptr
&
config
,
int
filternumber
)
{
KConfigGroup
grp
(
config
,
"General"
);
int
numberFilter
=
grp
.
readEntry
(
"NumberFilter"
).
toInt
();
if
(
filternumber
<
numberFilter
)
{
auto
filter
=
new
Filter
();
KConfigGroup
newGroup
(
config
,
QStringLiteral
(
"Filter_%1"
).
arg
(
filternumber
));
filter
->
setSearchString
(
newGroup
.
readEntry
(
"searchString"
),
static_cast
<
QuickSearchLine
::
SearchOptions
>
(
newGroup
.
readEntry
(
"searchOptions"
).
toInt
()));
filter
->
setCurrentFolder
(
Akonadi
::
Collection
(
newGroup
.
readEntry
(
"currentFolder"
).
toInt
()));
filter
->
setTagId
(
newGroup
.
readEntry
(
"tagId"
));
return
filter
;
}
return
nullptr
;
}
void
Filter
::
setSearchString
(
const
QString
&
search
,
QuickSearchLine
::
SearchOptions
options
)
...
...
messagelist/src/core/filter.h
View file @
630c8111
...
...
@@ -90,6 +90,7 @@ public:
Q_REQUIRED_RESULT
QuickSearchLine
::
SearchOptions
currentOptions
()
const
;
void
save
(
const
KSharedConfig
::
Ptr
&
config
,
const
QString
&
filtername
);
static
Q_REQUIRED_RESULT
Filter
*
load
(
const
KSharedConfig
::
Ptr
&
config
,
int
filternumber
);
Q_SIGNALS:
void
finished
();
...
...
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