From 07cf18a6b8ca50c65225daca9c1941ff2e2e54ab Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Thu, 19 Nov 2020 20:18:38 +0100 Subject: [PATCH] Reload KCM when entry was adopted This solves the UI sync issues when using the adoption command. CCBUG: 417983 --- kcms/icons/main.cpp | 9 +++------ kcms/icons/main.h | 2 +- kcms/icons/package/contents/ui/main.qml | 7 ++++++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/kcms/icons/main.cpp b/kcms/icons/main.cpp index c865233d8..8deda58b1 100644 --- a/kcms/icons/main.cpp +++ b/kcms/icons/main.cpp @@ -186,15 +186,12 @@ void IconModule::processPendingDeletions() m_model->removeItemsPendingDeletion(); } -void IconModule::ghnsEntriesChanged(const QQmlListReference &changedEntries) +void IconModule::ghnsEntriesChanged() { - if (changedEntries.count() == 0) { - return; - } - // reload the display icontheme items + KIconTheme::reconfigure(); KIconLoader::global()->newIconLoader(); - m_model->load(); + load(); QPixmapCache::clear(); } diff --git a/kcms/icons/main.h b/kcms/icons/main.h index 52e5caa2d..88b88c259 100644 --- a/kcms/icons/main.h +++ b/kcms/icons/main.h @@ -74,7 +74,7 @@ public: void load() override; void save() override; - Q_INVOKABLE void ghnsEntriesChanged(const QQmlListReference &changedEntries); + Q_INVOKABLE void ghnsEntriesChanged(); Q_INVOKABLE void installThemeFromFile(const QUrl &url); Q_INVOKABLE QList availableIconSizes(int group) const; diff --git a/kcms/icons/package/contents/ui/main.qml b/kcms/icons/package/contents/ui/main.qml index 290faf037..7427ae2b2 100644 --- a/kcms/icons/package/contents/ui/main.qml +++ b/kcms/icons/package/contents/ui/main.qml @@ -262,7 +262,12 @@ KCM.GridViewKCM { text: i18n("Get New Icons...") configFile: "icons.knsrc" viewMode: NewStuff.Page.ViewMode.Preview - onChangedEntriesChanged: kcm.ghnsEntriesChanged(newStuffButton.changedEntries); + Connections { + target: newStuffButton.engine.engine + function onSignalEntryEvent(entry, event) { + kcm.ghnsEntriesChanged(); + } + } } } }