~ci-train-bot/history-service/history-service-ubuntu-yakkety-landing-052

« back to all changes in this revision

Viewing changes to Ubuntu/History/historygroupedeventsmodel.cpp

Request contact information for all known participants on history-daemon initialization, and use this cached information on the models.
Approved by: Tiago Salem Herrmann, PS Jenkins bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include "phoneutils_p.h"
25
25
#include "sort.h"
26
26
#include "historyqmlsort.h"
 
27
#include "participant.h"
27
28
 
28
29
HistoryGroupedEventsModel::HistoryGroupedEventsModel(QObject *parent) :
29
30
    HistoryEventModel(parent)
86
87
    // than to do a binary search for each event, as it is very likely that the entries
87
88
    // belong to the bottom part of the model.
88
89
    Q_FOREACH(const History::Event event, events) {
 
90
        // watch for contact changes for the given identifiers
 
91
        Q_FOREACH(const History::Participant &participant, event.participants()) {
 
92
            watchContactInfo(event.accountId(), participant.identifier(), participant.properties());
 
93
        }
89
94
        bool found = false;
90
95
        int pos = mEventGroups.count() -1;
91
96
        for (; pos >= 0; pos--) {
202
207
 
203
208
        // now check if the values are the same
204
209
        if (property == History::FieldParticipants) {
205
 
            if (!History::Utils::compareParticipants(props1[property].toStringList(),
206
 
                                     props2[property].toStringList(),
207
 
                                     History::Utils::matchFlagsForAccount(accountId))) {
 
210
            if (!History::Utils::compareParticipants(event1.participants().identifiers(),
 
211
                                                     event2.participants().identifiers(),
 
212
                                                     History::Utils::matchFlagsForAccount(accountId))) {
208
213
                return false;
209
214
            }
210
215
        } else if (props1[property] != props2[property]) {