Verified Commit c442becf authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

icons kcm: Clear pending deletions when Defaults button is clicked

This makes it consistent with other KCMs and makes it more predictable:
When the user clicks default and then apply one would not expect the
KCM to delete entries. Especially in case the user has clicked buttons
by accident and wants to return to the initial state.

(cherry picked from commit 9ef9a79f)
parent cc1f8881
......@@ -498,4 +498,12 @@ int IconModule::pluginIndex(const QString &themeName) const
return -1;
}
void IconModule::defaults()
{
for (int i = 0, count = m_model->rowCount(QModelIndex()); i < count; ++i) {
m_model->setData(m_model->index(i), false, IconsModel::Roles::PendingDeletionRole);
}
ManagedConfigModule::defaults();
}
#include "main.moc"
......@@ -73,6 +73,7 @@ public:
void load() override;
void save() override;
void defaults() override;
Q_INVOKABLE void ghnsEntriesChanged();
Q_INVOKABLE void installThemeFromFile(const QUrl &url);
......
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