From a6a9a9023454d6333e99522d1669089160400be1 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Thu, 4 Feb 2016 07:06:33 -0600 Subject: [PATCH] backport systray applets not shown workaround (kde#352055) --- ...del-on-list-always-shown-hide-change.patch | 74 +++++++++++++++++++ plasma-workspace.spec | 8 +- 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 0001-reset-the-model-on-list-always-shown-hide-change.patch diff --git a/0001-reset-the-model-on-list-always-shown-hide-change.patch b/0001-reset-the-model-on-list-always-shown-hide-change.patch new file mode 100644 index 0000000..f0a8025 --- /dev/null +++ b/0001-reset-the-model-on-list-always-shown-hide-change.patch @@ -0,0 +1,74 @@ +From 42a3d8accd4e494d343954ddaa916a6c618d94f3 Mon Sep 17 00:00:00 2001 +From: Marco Martin +Date: Wed, 3 Feb 2016 15:36:31 +0100 +Subject: [PATCH] reset the model on list always shown/hide change + +something really wrong is going on on the proxymodel updates +the wrong item gets removed from the list. +it may be a wrong mapping between source and dest model +(doesn't seem so) +or may have been some misguided attempt by QML to recycle delegates + +anyways resetting the model in some conditions even if expensive +seems to be the only way to workaround this. +Anyways this systray implementation is beyond any repair and +the rewritten version won't have to rely on so many models +and proxymodels + +BUG:357627 +CCBUG:352055 +--- + applets/systemtray/plugin/tasksproxymodel.cpp | 13 ++++++++++--- + applets/systemtray/plugin/tasksproxymodel.h | 5 ++++- + 2 files changed, 14 insertions(+), 4 deletions(-) + +diff --git a/applets/systemtray/plugin/tasksproxymodel.cpp b/applets/systemtray/plugin/tasksproxymodel.cpp +index 632e84b..b93b05e 100644 +--- a/applets/systemtray/plugin/tasksproxymodel.cpp ++++ b/applets/systemtray/plugin/tasksproxymodel.cpp +@@ -50,9 +50,9 @@ void TasksProxyModel::setHost(Host *host) + + connect(m_host, &Host::taskStatusChanged, this, &TasksProxyModel::invalidateFilter); + connect(m_host, &Host::shownCategoriesChanged, this, &TasksProxyModel::invalidateFilter); +- connect(m_host, &Host::showAllItemsChanged, this, &TasksProxyModel::invalidateFilter); +- connect(m_host, &Host::forcedHiddenItemsChanged, this, &TasksProxyModel::invalidateFilter); +- connect(m_host, &Host::forcedShownItemsChanged, this, &TasksProxyModel::invalidateFilter); ++ connect(m_host, &Host::showAllItemsChanged, this, &TasksProxyModel::reset); ++ connect(m_host, &Host::forcedHiddenItemsChanged, this, &TasksProxyModel::reset); ++ connect(m_host, &Host::forcedShownItemsChanged, this, &TasksProxyModel::reset); + } + + invalidateFilter(); +@@ -74,6 +74,13 @@ void TasksProxyModel::setCategory(Category category) + } + } + ++void TasksProxyModel::reset() ++{ ++ beginResetModel(); ++ invalidateFilter(); ++ endResetModel(); ++} ++ + bool TasksProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const + { + Q_UNUSED(sourceParent); +diff --git a/applets/systemtray/plugin/tasksproxymodel.h b/applets/systemtray/plugin/tasksproxymodel.h +index 70e723a..5799d62 100644 +--- a/applets/systemtray/plugin/tasksproxymodel.h ++++ b/applets/systemtray/plugin/tasksproxymodel.h +@@ -56,7 +56,10 @@ public: + + virtual bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; + +-signals: ++private Q_SLOTS: ++ void reset(); ++ ++Q_SIGNALS: + void hostChanged(); + void categoryChanged(); + void countChanged(); +-- +2.5.0 + diff --git a/plasma-workspace.spec b/plasma-workspace.spec index 71c7e74..977b7ba 100644 --- a/plasma-workspace.spec +++ b/plasma-workspace.spec @@ -7,7 +7,7 @@ Name: plasma-workspace Summary: Plasma workspace, applications and applets Version: 5.5.4 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ URL: https://projects.kde.org/plasma-workspace @@ -40,6 +40,7 @@ Patch14: plasma-workspace-5.5.0-plasmawayland_desktop.patch Patch1: kde-runtime-4.9.0-installdbgsymbols.patch ## upstream Patches +Patch101: 0001-reset-the-model-on-list-always-shown-hide-change.patch ## master branch Patches @@ -340,6 +341,8 @@ Requires: qt5-qttools %prep %setup -q +%patch101 -p1 -b .0001 + %patch1 -p1 -b .installdbgsymbols %patch10 -p1 -b .konsole-in-contextmenu %if 0%{?fedora} > 21 @@ -562,6 +565,9 @@ fi %changelog +* Thu Feb 04 2016 Rex Dieter 5.5.4-2 +- backport systray applets not shown workaround (kde#352055) + * Wed Jan 27 2016 Daniel Vrátil - 5.5.4-1 - Plasma 5.5.4