I have made the following changes intended for :
  CE:MW:Shared / libcommhistory

Please review and accept or decline.
BOSS has already run some checks on this request.
See the "Messages from BOSS" section below.

https://build.pub.meego.com//request/show/5998

Thank You,
Marko Saukko

[This message was auto-generated]

---

Request # 5998:

Messages from BOSS:

State: review at 2012-08-21T19:02:04 by bossbot

Reviews:
       accepted by bossbot : Prechecks succeeded.
       new for CE-maintainers : Please replace this text with a review and 
approve/reject the review (not the SR). BOSS will take care of the rest

Changes:
  submit: Project:MTF:MW / libcommhistory -> CE:MW:Shared / libcommhistory
  
changes files:
--------------
--- libcommhistory.changes
+++ libcommhistory.changes
@@ -0,0 +1,3 @@
+* Thu Aug 09 2012 John Brooks <[email protected]> - 1.3.12.6
+- Add patch to fix a GroupModel crash
+

new:
----
  0001-Prevent-crash-from-early-ConversationModel-fetchMore.patch

spec files:
-----------
--- libcommhistory.spec
+++ libcommhistory.spec
@@ -7,6 +7,7 @@
 URL:        http://gitorious.org/commhistory/libcommhistory
 Source0:    %{name}-%{version}.tar.gz
 Patch0:     libcommhistory-1.3.12.6-fix-shared-static-lib-build-order.patch
+Patch1:     0001-Prevent-crash-from-early-ConversationModel-fetchMore.patch
 BuildRequires:  libqtcontacts-tracker-extensions-devel
 BuildRequires:  pkgconfig(QtCore) >= 4.7.0
 BuildRequires:  pkgconfig(QtContacts)
@@ -52,6 +53,7 @@
 %setup -q -n %{name}-%{version}
 
 %patch0 -p1
+%patch1 -p1
 
 %build
 unset LD_AS_NEEDED

other changes:
--------------

++++++ 0001-Prevent-crash-from-early-ConversationModel-fetchMore.patch (new)
--- 0001-Prevent-crash-from-early-ConversationModel-fetchMore.patch
+++ 0001-Prevent-crash-from-early-ConversationModel-fetchMore.patch
@@ -0,0 +1,41 @@
+From 17efab59f523e786b5748268be458e4f9a997726 Mon Sep 17 00:00:00 2001
+From: John Brooks <[email protected]>
+Date: Wed, 8 Aug 2012 23:38:04 -0400
+Subject: [PATCH 1/1] Prevent crash from early ConversationModel::fetchMore
+
+When called before the model data is ready, this would crash under
+eventAt.
+---
+ src/conversationmodel.cpp |    3 +++
+ src/eventtreeitem.cpp     |    1 +
+ 2 files changed, 4 insertions(+)
+
+diff --git a/src/conversationmodel.cpp b/src/conversationmodel.cpp
+index 7cf44e1..660f9cf 100644
+--- a/src/conversationmodel.cpp
++++ b/src/conversationmodel.cpp
+@@ -336,6 +336,9 @@ void ConversationModel::fetchMore(const QModelIndex 
&parent)
+     Q_UNUSED(parent);
+     Q_D(ConversationModel);
+ 
++    if (!d->isModelReady() || d->eventRootItem->childCount() < 1)
++        return;
++
+     EventsQuery query = d->buildQuery();
+ 
+     Event &event = d->eventRootItem->eventAt(d->eventRootItem->childCount() - 
1);
+diff --git a/src/eventtreeitem.cpp b/src/eventtreeitem.cpp
+index 202816c..a46edec 100644
+--- a/src/eventtreeitem.cpp
++++ b/src/eventtreeitem.cpp
+@@ -79,6 +79,7 @@ EventTreeItem *EventTreeItem::child(int row)
+ 
+ Event &EventTreeItem::eventAt(int row)
+ {
++    Q_ASSERT(row >= 0 && row < children.count());
+     return children.value(row)->event();
+ }
+ 
+-- 
+1.7.9.5
+



Reply via email to