Hrvoje Senjan 2016-02-04 16:21:45 +00:00 committed by Git OBS Bridge
parent c133b0c955
commit 7325627795
3 changed files with 82 additions and 0 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Feb 4 16:20:20 UTC 2016 - hrvoje.senjan@gmail.com
- Added reset-the-model-on-list-always-shown-hide-change.patch
(kde#357627, kde#352055)
-------------------------------------------------------------------
Tue Jan 26 22:20:18 UTC 2016 - hrvoje.senjan@gmail.com

View File

@ -35,6 +35,7 @@ Patch1: create_kdehome.patch
# PATCH-FIX_OPENSUSE fix-breeze-sddm-theme-with-many-users.patch alarrosa@suse.com -- Asks for user/password and hide the user list when there's a large number of users
Patch2: fix-breeze-sddm-theme-with-many-users.patch
# PATCHES 100-200 and above are from upstream 5.5 branch
Patch100: reset-the-model-on-list-always-shown-hide-change.patch
# PATCHES 201-300 and above are from upstream master/5.6 branch
BuildRequires: kf5-filesystem
BuildRequires: update-desktop-files
@ -203,6 +204,7 @@ workspace. Development files.
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch100 -p1
%build
%cmake_kf5 -d build -- -DKDE4_COMMON_PAM_SERVICE=xdm -DKDE_DEFAULT_HOME=.kde4 -DCMAKE_INSTALL_LOCALEDIR=share/locale/kf5

View File

@ -0,0 +1,74 @@
From 42a3d8accd4e494d343954ddaa916a6c618d94f3 Mon Sep 17 00:00:00 2001
From: Marco Martin <notmart@gmail.com>
Date: Wed, 3 Feb 2016 15:36:31 +0100
Subject: [PATCH 1/1] 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.6.2