Commit 2ee9edc1 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Delete all filter info because to resave it

parent 414d957e
Pipeline #63994 passed with stage
in 39 minutes and 52 seconds
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <KConfigGroup> #include <KConfigGroup>
#include <KSharedConfig> #include <KSharedConfig>
#include <QMenu> #include <QMenu>
#include <QRegularExpression>
using namespace MessageList::Core; using namespace MessageList::Core;
FilterSavedManager::FilterSavedManager(QObject *parent) FilterSavedManager::FilterSavedManager(QObject *parent)
: QObject(parent) : QObject(parent)
...@@ -71,7 +72,11 @@ void FilterSavedManager::removeFilter(const QString &identifier) ...@@ -71,7 +72,11 @@ void FilterSavedManager::removeFilter(const QString &identifier)
Filter *f = Filter::load(KSharedConfig::openConfig(), i); Filter *f = Filter::load(KSharedConfig::openConfig(), i);
lst << f; lst << f;
} }
// TODO Delete all filters before to save it
const QStringList list = KSharedConfig::openConfig()->groupList().filter(QRegularExpression(QStringLiteral("Filter_\\d+")));
for (const QString &group : list) {
KSharedConfig::openConfig()->deleteGroup(group);
}
int numberOfFilter = 0; int numberOfFilter = 0;
for (Filter *f : qAsConst(lst)) { for (Filter *f : qAsConst(lst)) {
......
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