[kdepim-runtime] KAlarmCal::EventAttribute::commandError makes Kontact crash (kde#297039)

Rex Dieter rdieter at fedoraproject.org
Sun Apr 1 22:32:32 UTC 2012


commit 3f4665581beb3c1bb7fa4875dd9cd482ef7af6ff
Author: Rex Dieter <rdieter at fedoraproject.org>
Date:   Sun Apr 1 17:34:26 2012 -0500

    KAlarmCal::EventAttribute::commandError makes Kontact crash (kde#297039)

 kdepim-runtime-4.8.2-kdebug297039.patch |   76 +++++++++++++++++++++++++++++++
 kdepim-runtime.spec                     |    8 +++-
 2 files changed, 83 insertions(+), 1 deletions(-)
---
diff --git a/kdepim-runtime-4.8.2-kdebug297039.patch b/kdepim-runtime-4.8.2-kdebug297039.patch
new file mode 100644
index 0000000..d23cc47
--- /dev/null
+++ b/kdepim-runtime-4.8.2-kdebug297039.patch
@@ -0,0 +1,76 @@
+commit 85aabae810197bc220215a7dde6225c0a99d065a
+Author: David Jarvie <djarvie at kde.org>
+Date:   Fri Mar 30 23:35:04 2012 +0100
+
+    Fix crash when fetching attribute.
+    
+    Use member variable to control initialisation, not static variable.
+    
+    Backport of 32f4856a753e83328fe6b602d84a241de7db4479 (master).
+    
+    BUG:297039
+
+diff --git a/plugins/akonadi_serializer_kalarm.cpp b/plugins/akonadi_serializer_kalarm.cpp
+index 9f78665..c651dad 100644
+--- a/plugins/akonadi_serializer_kalarm.cpp
++++ b/plugins/akonadi_serializer_kalarm.cpp
+@@ -1,6 +1,6 @@
+ /*
+  *  akonadi_serializer_kalarm.cpp  -  Akonadi resource serializer for KAlarm
+- *  Copyright © 2009-2011 by David Jarvie <djarvie at kde.org>
++ *  Copyright © 2009-2012 by David Jarvie <djarvie at kde.org>
+  *
+  *  This library is free software; you can redistribute it and/or modify it
+  *  under the terms of the GNU Library General Public License as published by
+@@ -61,7 +61,7 @@ bool SerializerPluginKAlarm::deserialize(Item& item, const QByteArray& label, QI
+         return false;
+     }
+     KAEvent event(i.staticCast<KCalCore::Event>());
+-    QString mime = CalEvent::mimeType(event.category());
++    const QString mime = CalEvent::mimeType(event.category());
+     if (mime.isEmpty()  ||  !event.isValid())
+     {
+         kWarning(5263) << "Event with uid" << event.id() << "contains no usable alarms!";
+@@ -71,11 +71,10 @@ bool SerializerPluginKAlarm::deserialize(Item& item, const QByteArray& label, QI
+     event.setItemId(item.id());
+ 
+     // Set additional event data contained in attributes
+-    static bool attrRegistered = false;
+-    if (!attrRegistered)
++    if (mRegistered.isEmpty())
+     {
+         AttributeFactory::registerAttribute<KAlarmCal::EventAttribute>();
+-        attrRegistered = true;
++        mRegistered = QLatin1String("x");   // set to any non-null string
+     }
+     if (item.hasAttribute<EventAttribute>())
+     {
+@@ -95,7 +94,7 @@ void SerializerPluginKAlarm::serialize(const Item& item, const QByteArray& label
+ 
+     if (label != Item::FullPayload || !item.hasPayload<KAEvent>())
+         return;
+-    KAEvent e = item.payload<KAEvent>();
++    const KAEvent e = item.payload<KAEvent>();
+     KCalCore::Event::Ptr kcalEvent(new KCalCore::Event);
+     e.updateKCalEvent(kcalEvent, KAEvent::UID_SET);
+     QByteArray head = "BEGIN:VCALENDAR\nPRODID:";
+diff --git a/plugins/akonadi_serializer_kalarm.h b/plugins/akonadi_serializer_kalarm.h
+index 1a6ae09..fc80607 100644
+--- a/plugins/akonadi_serializer_kalarm.h
++++ b/plugins/akonadi_serializer_kalarm.h
+@@ -1,6 +1,6 @@
+ /*
+  *  akonadi_serializer_kalarm.h  -  Akonadi resource serializer for KAlarm
+- *  Copyright © 2009-2011 by David Jarvie <djarvie at kde.org>
++ *  Copyright © 2009-2012 by David Jarvie <djarvie at kde.org>
+  *
+  *  This library is free software; you can redistribute it and/or modify it
+  *  under the terms of the GNU Library General Public License as published by
+@@ -50,6 +50,7 @@ class SerializerPluginKAlarm : public QObject,
+         KCalCore::ICalFormat mFormat;
+         KAEventFormatter mValueL;
+         KAEventFormatter mValueR;
++        QString mRegistered;
+ };
+ 
+ #endif // AKONADI_SERIALIZER_KALARM_H
diff --git a/kdepim-runtime.spec b/kdepim-runtime.spec
index 7683e25..da6c972 100644
--- a/kdepim-runtime.spec
+++ b/kdepim-runtime.spec
@@ -5,7 +5,7 @@ Name:    kdepim-runtime
 Summary: KDE PIM Runtime Environment
 Epoch:   1
 Version: 4.8.2
-Release: 1%{?dist}
+Release: 2%{?dist}
 
 License: GPLv2
 Group: Applications/Productivity
@@ -27,6 +27,8 @@ Patch0: kdepim-runtime-4.4.93-show_akonadi_kcm.patch
 Patch50: 0001-add-sqlite-support-to-akonadi-kcm.patch 
 
 ## upstream patches
+# https://projects.kde.org/projects/kde/kdepim-runtime/repository/revisions/85aabae810197bc220215a7dde6225c0a99d065a
+Patch100:  kdepim-runtime-4.8.2-kdebug297039.patch 
 
 # nuke ill-advised -devel pkg
 Obsoletes: kdepim-runtime-devel < 1:4.7.90-3
@@ -66,6 +68,7 @@ Requires: akonadi%{?_isa} >= %{akonadi_version}
 
 %patch0 -p1 -b .show_akonadi_kcm
 %patch50 -p1 -b .akonadi_kcm_sqlite
+%patch100 -p1 -b .kdebug297039
 
 
 %build
@@ -152,6 +155,9 @@ fi
 
 
 %changelog
+* Sun Apr 01 2012 Rex Dieter <rdieter at fedoraproject.org> 1:4.8.2-1
+- KAlarmCal::EventAttribute::commandError makes Kontact crash (kde#297039)
+
 * Fri Mar 30 2012 Rex Dieter <rdieter at fedoraproject.org> - 1:4.8.2-1
 - 4.8.2
 


More information about the scm-commits mailing list