Commit 851713c3 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Prepare to store filter

parent adc5314c
Pipeline #60172 passed with stage
in 40 minutes and 19 seconds
...@@ -124,6 +124,20 @@ QuickSearchLine::SearchOptions Filter::currentOptions() const ...@@ -124,6 +124,20 @@ QuickSearchLine::SearchOptions Filter::currentOptions() const
return mOptions; 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) void Filter::setSearchString(const QString &search, QuickSearchLine::SearchOptions options)
{ {
const QString trimStr = search.trimmed(); const QString trimStr = search.trimmed();
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "widgets/quicksearchline.h" #include "widgets/quicksearchline.h"
#include <Akonadi/KMime/MessageStatus> #include <Akonadi/KMime/MessageStatus>
#include <Collection> #include <Collection>
#include <KSharedConfig>
namespace MessageList namespace MessageList
{ {
...@@ -87,6 +88,8 @@ public: ...@@ -87,6 +88,8 @@ public:
Q_REQUIRED_RESULT bool isEmpty() const; Q_REQUIRED_RESULT bool isEmpty() const;
Q_REQUIRED_RESULT QuickSearchLine::SearchOptions currentOptions() const; Q_REQUIRED_RESULT QuickSearchLine::SearchOptions currentOptions() const;
void save(const KSharedConfig::Ptr &config, const QString &filtername);
Q_SIGNALS: Q_SIGNALS:
void finished(); void finished();
......
Markdown is supported
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