Commit 271ba22f authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to change icon name

parent b25d8adb
......@@ -119,7 +119,7 @@ void FilterSavedManager::removeFilter(const QString &identifier)
lst.clear();
}
void FilterSavedManager::updateFilter(const QString &identifier, const QString &newName)
void FilterSavedManager::updateFilter(const QString &identifier, const QString &newName, const QString &iconName)
{
KConfigGroup grp(KSharedConfig::openConfig(), "General");
const int numberFilter = grp.readEntry("NumberFilter").toInt();
......@@ -127,6 +127,9 @@ void FilterSavedManager::updateFilter(const QString &identifier, const QString &
KConfigGroup newGroup(KSharedConfig::openConfig(), QStringLiteral("Filter_%1").arg(i));
if (newGroup.readEntry("identifier") == identifier) {
newGroup.writeEntry("name", newName);
if (!iconName.isEmpty()) {
newGroup.writeEntry("iconName", iconName);
}
newGroup.sync();
break;
}
......
......@@ -31,7 +31,7 @@ public:
static FilterSavedManager *self();
void removeFilter(const QString &identifier);
void updateFilter(const QString &identifier, const QString &newName);
void updateFilter(const QString &identifier, const QString &newName, const QString &iconName = {});
Q_REQUIRED_RESULT Filter *loadFilter(const QString &identifier);
Q_REQUIRED_RESULT QStringList existingFilterNames() const;
......
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