From cc11cf8f9b810b9d070ba2e1a73bc7f488bbbfa5fd8ebb43ff95f94adcde823b Mon Sep 17 00:00:00 2001 From: Hrvoje Senjan Date: Mon, 8 Feb 2016 16:08:57 +0000 Subject: [PATCH] Accepting request 358356 from home:wolfi323:test - Add fix-crash-in-activities-context-menu.patch: fixes a dolphin and desktop crash when right-clicking on a file and opening the "Activities" submenu (boo#952139, kde#351485) OBS-URL: https://build.opensuse.org/request/show/358356 OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kactivities5?expand=0&rev=102 --- fix-crash-in-activities-context-menu.patch | 82 ++++++++++++++++++++++ kactivities5.changes | 7 ++ kactivities5.spec | 3 + 3 files changed, 92 insertions(+) create mode 100644 fix-crash-in-activities-context-menu.patch diff --git a/fix-crash-in-activities-context-menu.patch b/fix-crash-in-activities-context-menu.patch new file mode 100644 index 0000000..ed9b162 --- /dev/null +++ b/fix-crash-in-activities-context-menu.patch @@ -0,0 +1,82 @@ +From: David Edmundson +Date: Sat, 06 Feb 2016 18:02:53 +0000 +Subject: Fix crash in activities context menu +X-Git-Url: http://quickgit.kde.org/?p=kactivities.git&a=commitdiff&h=b3c8ad1ad48d65ea77724f94073909dc8ab97596 +--- +Fix crash in activities context menu + +Currently we call deleteLater() from inside ::run which is running in a +different thread than the receiving object. +(QThread objects live in the thread that created them, not in the thread +they create) + +This patch causes deleteLater to be run in the right thread. + +QCoreApplication::postEvent is thread safe but it needs to be in the +right thread to work out the correct event loop level for deferred +delete events. + +BUG: 351485 +REVIEW: 126955 +--- + + +--- a/src/workspace/fileitemplugin/FileItemLinkingPlugin.cpp ++++ b/src/workspace/fileitemplugin/FileItemLinkingPlugin.cpp +@@ -124,7 +124,7 @@ + setActions({ action }); + + } else if (!loaded) { +- auto loader = new FileItemLinkingPluginActionLoader(items); ++ auto loader = FileItemLinkingPluginActionLoader::create(items); + + static FileItemLinkingPluginActionStaticInit init; + + +--- a/src/workspace/fileitemplugin/FileItemLinkingPluginActionLoader.cpp ++++ b/src/workspace/fileitemplugin/FileItemLinkingPluginActionLoader.cpp +@@ -39,6 +39,13 @@ + #include + + #include "common/dbus/common.h" ++ ++FileItemLinkingPluginActionLoader* FileItemLinkingPluginActionLoader::create(const KFileItemListProperties &items) ++{ ++ auto l = new FileItemLinkingPluginActionLoader(items); ++ connect(l, &QThread::finished, l, &QObject::deleteLater); ++ return l; ++} + + FileItemLinkingPluginActionLoader::FileItemLinkingPluginActionLoader( + const KFileItemListProperties &items) +@@ -150,8 +157,6 @@ + } + + emit result(actions); +- +- deleteLater(); + } + + Action + +--- a/src/workspace/fileitemplugin/FileItemLinkingPluginActionLoader.h ++++ b/src/workspace/fileitemplugin/FileItemLinkingPluginActionLoader.h +@@ -33,8 +33,7 @@ + Q_OBJECT + + public: +- FileItemLinkingPluginActionLoader(const KFileItemListProperties &items); +- ++ static FileItemLinkingPluginActionLoader* create(const KFileItemListProperties &items); + void run() Q_DECL_OVERRIDE; + + Action createAction(const QString &activity, bool link, +@@ -46,6 +45,7 @@ + void result(const ActionList &actions); + + private: ++ FileItemLinkingPluginActionLoader(const KFileItemListProperties &items); + KFileItemListProperties items; + KActivities::Consumer activities; + }; + diff --git a/kactivities5.changes b/kactivities5.changes index d1ee5a4..54a9867 100644 --- a/kactivities5.changes +++ b/kactivities5.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sun Feb 7 05:32:00 UTC 2016 - wbauer@tmo.at + +- Add fix-crash-in-activities-context-menu.patch: fixes a dolphin + and desktop crash when right-clicking on a file and opening the + "Activities" submenu (boo#952139, kde#351485) + ------------------------------------------------------------------- Sat Feb 6 17:59:01 UTC 2016 - hrvoje.senjan@gmail.com diff --git a/kactivities5.spec b/kactivities5.spec index e63a7dd..5ae0b93 100644 --- a/kactivities5.spec +++ b/kactivities5.spec @@ -29,6 +29,8 @@ Group: System/GUI/KDE Url: http://projects.kde.org/kactivities Source: http://download.kde.org/stable/frameworks/%{_tar_path}/kactivities-%{version}.tar.xz Source1: baselibs.conf +# PATCH-FIX-UPSTREAM fix-crash-in-activities-context-menu.patch boo#952139, kde#351485 -- fixes a dolphin and desktop crash when right-clicking on a file and opening the "Activities" submenu +Patch: fix-crash-in-activities-context-menu.patch BuildRequires: boost-devel >= 1.49.0 BuildRequires: cmake >= 2.8.12 BuildRequires: extra-cmake-modules >= %{_tar_path} @@ -96,6 +98,7 @@ Development files. %lang_package -n %lname %prep %setup -q -n kactivities-%{version} +%patch -p1 %build %if 0%{?suse_version} == 1310