Commit 42a922ac authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Load filter info

parent 8d8560be
Pipeline #63178 passed with stage
in 39 minutes and 36 seconds
......@@ -46,8 +46,19 @@ void FilterSavedManager::loadMenu(QMenu *menu)
QVector<FilterSavedManager::FilterInfo> FilterSavedManager::filterInfos() const
{
// TODO
return {};
KConfigGroup grp(KSharedConfig::openConfig(), "General");
const int numberFilter = grp.readEntry("NumberFilter").toInt();
QVector<FilterSavedManager::FilterInfo> lst;
lst.reserve(numberFilter);
for (int i = 0; i < numberFilter; ++i) {
KConfigGroup newGroup(KSharedConfig::openConfig(), QStringLiteral("Filter_%1").arg(i));
FilterSavedManager::FilterInfo info;
info.filterName = newGroup.readEntry(QStringLiteral("name"));
info.identifier = newGroup.readEntry(QStringLiteral("identifier"));
lst << info;
}
return lst;
}
void FilterSavedManager::removeFilter(const QString &identifier)
......
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