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/6888 Thank You, John Brooks [This message was auto-generated] --- Request # 6888: Messages from BOSS: State: review at 2012-10-04T07:54:40 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: home:special:branches:CE:MW:Shared / libcommhistory -> CE:MW:Shared / libcommhistory changes files: -------------- --- libcommhistory.changes +++ libcommhistory.changes @@ -0,0 +1,4 @@ +* Wed Oct 03 2012 John Brooks <[email protected]> - 1.4.1 +- Add contactIds role to GroupModel for QML +- Start ContactListener before making a request in GroupModel + old: ---- libcommhistory-1.4.0.tar.bz2 new: ---- libcommhistory-1.4.1.tar.bz2 spec files: ----------- --- libcommhistory.spec +++ libcommhistory.spec @@ -1,6 +1,6 @@ Name: libcommhistory Summary: Communications event history database API -Version: 1.4.0 +Version: 1.4.1 Release: 1 Group: System/Libraries License: LGPL other changes: -------------- ++++++ libcommhistory-1.4.0.tar.bz2 -> libcommhistory-1.4.1.tar.bz2 --- src/groupmodel.cpp +++ src/groupmodel.cpp @@ -252,8 +252,6 @@ q->rowCount() + result.count() - 1); groups.append(result); q->endInsertRows(); - - startContactListening(); } } @@ -648,6 +646,7 @@ roles[BaseRole + IsPermanent] = "isPermanent"; roles[BaseRole + LastModified] = "lastModified"; roles[BaseRole + StartTime] = "startTime"; + roles[ContactIdsRole] = "contactIds"; setRoleNames(roles); } @@ -705,6 +704,12 @@ if (role == GroupRole) { return QVariant::fromValue(group); + } else if (role == ContactIdsRole) { + QList<int> ids; + ids.reserve(group.contacts().size()); + foreach (const Event::Contact &c, group.contacts()) + ids.append(c.first); + return QVariant::fromValue(ids); } int column = index.column(); @@ -957,6 +962,8 @@ endResetModel(); } + d->startContactListening(); + QSparqlQuery query(TrackerIOPrivate::prepareGroupQuery(localUid, remoteUid)); d->executeQuery(query.preparedQueryText()); --- src/groupmodel.h +++ src/groupmodel.h @@ -76,6 +76,7 @@ enum Role { GroupRole = Qt::UserRole, + ContactIdsRole, BaseRole = Qt::UserRole + 1000 };
