[kde-plasma-smooth-tasks] Fix crash when startup item is deleted

Radek Novacek rnovacek at fedoraproject.org
Mon Mar 19 09:05:58 UTC 2012


commit c69444a57920437eb389441859d04700e28d2df0
Author: Radek Novacek <rnovacek at redhat.com>
Date:   Mon Mar 19 10:05:08 2012 +0100

    Fix crash when startup item is deleted

 kde-plasma-smooth-tasks.spec                       |    8 ++-
 ...-fork-0.0.1-fix-crash-on-item-destruction.patch |   69 ++++++++++++++++++++
 2 files changed, 76 insertions(+), 1 deletions(-)
---
diff --git a/kde-plasma-smooth-tasks.spec b/kde-plasma-smooth-tasks.spec
index 2764c61..f0ddd68 100644
--- a/kde-plasma-smooth-tasks.spec
+++ b/kde-plasma-smooth-tasks.spec
@@ -1,6 +1,6 @@
 Name:		kde-plasma-smooth-tasks
 Version:	0.0.1
-Release:	0.4.20120313hge8a97edfdebc%{?dist}
+Release:	0.5.20120313hge8a97edfdebc%{?dist}
 Summary:	KDE taskbar replacement with window peeking ability
 
 Group:		User Interface/Desktops
@@ -11,6 +11,8 @@ URL:		https://bitbucket.org/flupp/smooth-tasks-fork
 #  hg clone https://bitbucket.org/flupp/smooth-tasks-fork
 #  hg archive -r e8a97edfdebc smooth-tasks-fork-e8a97edfdebc.tar.gz
 Source0:	smooth-tasks-fork-e8a97edfdebc.tar.gz
+# Crash when startup item is deleted
+Patch0:		smooth-tasks-fork-0.0.1-fix-crash-on-item-destruction.patch
 
 BuildRequires:	gettext, kdebase-workspace-devel
 Requires:	kdebase-workspace
@@ -28,6 +30,7 @@ to activate the corresponding window.
 %setup -q -n smooth-tasks-fork-e8a97edfdebc
 ## Due to the name change this sed is needed for find-lang.
 sed -i 's,set(catalogname plasma_applet_smooth-tasks),set(catalogname kde-plasma-smooth-tasks),g' po/CMakeLists.txt
+%patch0 -p1
 
 %build
 mkdir -p %{_target_platform}
@@ -49,6 +52,9 @@ make install/fast -C %{_target_platform} DESTDIR=%{buildroot}
 
 
 %changelog
+* Fri Mar 16 2012 Radek Novacek <rnovacek at redhat.com> 0.0.1-0.5.20120313hge8a97edfdebc
+- Fix crash when startup item is deleted
+
 * Tue Mar 13 2012 Radek Novacek <rnovacek at redhat.com> 0.0.1-0.4.20120313hge8a97edfdebc
 - Use smooth-tasks-fork instead of original smooth-tasks (upstream seems dead)
 
diff --git a/smooth-tasks-fork-0.0.1-fix-crash-on-item-destruction.patch b/smooth-tasks-fork-0.0.1-fix-crash-on-item-destruction.patch
new file mode 100644
index 0000000..2ddd87d
--- /dev/null
+++ b/smooth-tasks-fork-0.0.1-fix-crash-on-item-destruction.patch
@@ -0,0 +1,69 @@
+diff -r e8a97edfdebc applet/SmoothTasks/Task.cpp
+--- a/applet/SmoothTasks/Task.cpp	Sat Mar 03 23:20:42 2012 +0100
++++ b/applet/SmoothTasks/Task.cpp	Mon Mar 19 10:03:15 2012 +0100
+@@ -83,6 +83,7 @@
+ }
+ 
+ void Task::itemDestroyed() {
++	emit destroyed();
+ 	m_abstractItem = NULL;
+ 	m_task         = NULL;
+ 	m_group        = NULL;
+diff -r e8a97edfdebc applet/SmoothTasks/Task.h
+--- a/applet/SmoothTasks/Task.h	Sat Mar 03 23:20:42 2012 +0100
++++ b/applet/SmoothTasks/Task.h	Mon Mar 19 10:03:15 2012 +0100
+@@ -114,6 +114,7 @@
+ 	void updateIcon(const QIcon& icon);
+ 	void update();
+ 	void gotTask();
++	void destroyed();
+ };
+ 
+ } // namespace SmoothTasks
+diff -r e8a97edfdebc applet/SmoothTasks/TaskItem.cpp
+--- a/applet/SmoothTasks/TaskItem.cpp	Sat Mar 03 23:20:42 2012 +0100
++++ b/applet/SmoothTasks/TaskItem.cpp	Mon Mar 19 10:03:15 2012 +0100
+@@ -122,6 +122,9 @@
+ 	
+ 	// light
+ 	connect(m_light, SIGNAL(update()), this, SLOT(update()));
++
++	//destroyed
++	connect(m_task, SIGNAL(destroyed()), this, SLOT(taskDestroyed()));
+ 	
+ 	m_preferredTextLayoutSize = ::SmoothTasks::preferredTextLayoutSize(m_task->text(), KGlobalSettings::taskbarFont());
+ 	
+@@ -833,6 +836,9 @@
+ 	Q_UNUSED(option);
+ 	Q_UNUSED(widget);
+ 
++	if (m_task == NULL)
++		return;
++
+ 	const QRectF bounds = boundingRect();
+ 	
+ 	if (!bounds.isValid())
+@@ -1348,5 +1354,12 @@
+ 	return expanderElement(m_applet->location(), m_orientation);
+ }
+ 
++void TaskItem::taskDestroyed()
++{
++	m_task = NULL;
++	m_abstractItem = NULL;
++	deleteLater();
++}
++
+ } // namespace SmoothTasks
+ #include "TaskItem.moc"
+diff -r e8a97edfdebc applet/SmoothTasks/TaskItem.h
+--- a/applet/SmoothTasks/TaskItem.h	Sat Mar 03 23:20:42 2012 +0100
++++ b/applet/SmoothTasks/TaskItem.h	Mon Mar 19 10:03:15 2012 +0100
+@@ -190,6 +190,7 @@
+ 	void updateToolTip();
+ 	void publishIconGeometry();
+ 	void updateExpansion();
++	void taskDestroyed();
+ };
+ 
+ } // namespace SmoothTasks


More information about the scm-commits mailing list