Skip to content
GitLab
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
851713c3
Commit
851713c3
authored
Apr 29, 2021
by
Laurent Montel
Browse files
Prepare to store filter
parent
adc5314c
Pipeline
#60172
passed with stage
in 40 minutes and 19 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
messagelist/src/core/filter.cpp
View file @
851713c3
...
...
@@ -124,6 +124,20 @@ QuickSearchLine::SearchOptions Filter::currentOptions() const
return
mOptions
;
}
void
Filter
::
save
(
const
KSharedConfig
::
Ptr
&
config
,
const
QString
&
filtername
)
{
KConfigGroup
grp
(
config
,
"General"
);
int
numberFilter
=
grp
.
readEntry
(
"NumberFilter"
).
toInt
();
KConfigGroup
newGroup
(
config
,
QStringLiteral
(
"Filter_%1"
).
arg
(
numberFilter
++
));
newGroup
.
writeEntry
(
"name"
,
filtername
);
newGroup
.
writeEntry
(
"searchString"
,
mSearchString
);
// TODO newGroup.writeEntry("searchOptions", mOptions);
newGroup
.
writeEntry
(
"tagId"
,
mTagId
);
// newGroup.writeEntry("currentFolder", mCurrentFolder);
// TODO mStatus.toQInt32()
newGroup
.
sync
();
}
void
Filter
::
setSearchString
(
const
QString
&
search
,
QuickSearchLine
::
SearchOptions
options
)
{
const
QString
trimStr
=
search
.
trimmed
();
...
...
messagelist/src/core/filter.h
View file @
851713c3
...
...
@@ -15,6 +15,7 @@
#include
"widgets/quicksearchline.h"
#include
<Akonadi/KMime/MessageStatus>
#include
<Collection>
#include
<KSharedConfig>
namespace
MessageList
{
...
...
@@ -87,6 +88,8 @@ public:
Q_REQUIRED_RESULT
bool
isEmpty
()
const
;
Q_REQUIRED_RESULT
QuickSearchLine
::
SearchOptions
currentOptions
()
const
;
void
save
(
const
KSharedConfig
::
Ptr
&
config
,
const
QString
&
filtername
);
Q_SIGNALS:
void
finished
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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