Gentoo Archives: gentoo-commits

From: "Andreas HAttel (dilfridge)" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in kde-base/plasma-workspace/files: plasma-workspace-4.7.3-calendarcrash.patch
Date: Tue, 22 Nov 2011 22:50:12
Message-Id: 20111122224957.6EE752004C@flycatcher.gentoo.org
1 dilfridge 11/11/22 22:49:57
2
3 Added: plasma-workspace-4.7.3-calendarcrash.patch
4 Log:
5 Backport another crash fix, bug 391355
6
7 (Portage version: 2.1.10.36/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 kde-base/plasma-workspace/files/plasma-workspace-4.7.3-calendarcrash.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/kde-base/plasma-workspace/files/plasma-workspace-4.7.3-calendarcrash.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/kde-base/plasma-workspace/files/plasma-workspace-4.7.3-calendarcrash.patch?rev=1.1&content-type=text/plain
14
15 Index: plasma-workspace-4.7.3-calendarcrash.patch
16 ===================================================================
17 commit 44a9c26b9eb27df8297618764f988972d476dc84
18 Author: David E. Narváez <david.narvaez@××××××××.org>
19 Date: Sun Nov 20 16:31:15 2011 -0500
20
21 Drop InvisibleCollectionFetch in Favor of KDescendantsProxyModel
22
23 As the InvisibleCollectionFetch fetch strategy is currently broken, I
24 implemented a suggestion by Christian Mollekopf of working around the
25 issues by flatting the model through a KDescendantsProxyModel to fix
26 crashes in Plasma related to calendars.
27
28 BUG: 279322
29 FIXED-IN: 4.7.4
30
31 CCMAIL: chrigi_1@××××××××.fm
32 REVIEW: 103088
33
34 diff --git a/plasma/generic/dataengines/calendar/calendarengine.cpp b/plasma/generic/dataengines/calendar/calendarengine.cpp
35 index 53f98c0..f8b3a90 100644
36 --- a/plasma/generic/dataengines/calendar/calendarengine.cpp
37 +++ b/plasma/generic/dataengines/calendar/calendarengine.cpp
38 @@ -31,6 +31,7 @@
39 #include <KCalCore/Event>
40 #include <KCalCore/Todo>
41 #include <KCalCore/Journal>
42 +#include <kdescendantsproxymodel.h>
43
44 #ifdef AKONADI_FOUND
45 #include <Akonadi/ChangeRecorder>
46 @@ -38,6 +39,7 @@
47 #include <Akonadi/Collection>
48 #include <Akonadi/ItemFetchScope>
49 #include <Akonadi/EntityDisplayAttribute>
50 +#include <Akonadi/EntityMimeTypeFilterModel>
51
52 #include "akonadi/calendar.h"
53 #include "akonadi/calendarmodel.h"
54 @@ -341,8 +343,12 @@ void CalendarEngine::initAkonadiCalendar()
55
56 // create the models that contain the data. they will be updated automatically from akonadi.
57 CalendarSupport::CalendarModel *calendarModel = new CalendarSupport::CalendarModel(monitor, this);
58 - calendarModel->setCollectionFetchStrategy(Akonadi::EntityTreeModel::InvisibleCollectionFetch);
59 - m_calendar = new CalendarSupport::Calendar(calendarModel, calendarModel, KSystemTimeZones::local());
60 + KDescendantsProxyModel *flatModel = new KDescendantsProxyModel(this);
61 + flatModel->setSourceModel(calendarModel);
62 + Akonadi::EntityMimeTypeFilterModel *mimeFilteredModel = new Akonadi::EntityMimeTypeFilterModel(this);
63 + mimeFilteredModel->addMimeTypeExclusionFilter(Akonadi::Collection::mimeType());
64 + mimeFilteredModel->setSourceModel(flatModel);
65 + m_calendar = new CalendarSupport::Calendar(mimeFilteredModel, mimeFilteredModel, KSystemTimeZones::local());
66 }
67 #endif