~ci-train-bot/history-service/history-service-ubuntu-zesty-2629

« back to all changes in this revision

Viewing changes to src/thread.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:
1
1
/*
2
 
 * Copyright (C) 2013 Canonical, Ltd.
 
2
 * Copyright (C) 2013-2015 Canonical, Ltd.
3
3
 *
4
4
 * Authors:
5
5
 *  Gustavo Pichorim Boiko <gustavo.boiko@canonical.com>
39
39
 
40
40
ThreadPrivate::ThreadPrivate(const QString &theAccountId,
41
41
                                           const QString &theThreadId, EventType theType,
42
 
                                           const QStringList &theParticipants,
 
42
                                           const Participants &theParticipants,
43
43
                                           const Event &theLastEvent,
44
44
                                           int theCount,
45
45
                                           int theUnreadCount,
62
62
 
63
63
Thread::Thread(const QString &accountId,
64
64
               const QString &threadId, EventType type,
65
 
               const QStringList &participants,
 
65
               const Participants &participants,
66
66
               const Event &lastEvent,
67
67
               int count,
68
68
               int unreadCount,
109
109
    return d->type;
110
110
}
111
111
 
112
 
QStringList Thread::participants() const
 
112
Participants Thread::participants() const
113
113
{
114
114
    Q_D(const Thread);
115
115
    return d->participants;
182
182
    map[FieldAccountId] = d->accountId;
183
183
    map[FieldThreadId] = d->threadId;
184
184
    map[FieldType] = d->type;
185
 
    map[FieldParticipants] = d->participants;
 
185
    map[FieldParticipants] = d->participants.toVariantList();
186
186
    map[FieldCount] = d->count;
187
187
    map[FieldUnreadCount] = d->unreadCount;
188
188
    map[FieldLastEventId] = lastEvent().eventId();
210
210
    QString accountId = properties[FieldAccountId].toString();
211
211
    QString threadId = properties[FieldThreadId].toString();
212
212
    EventType type = (EventType) properties[FieldType].toInt();
213
 
    QStringList participants = properties[FieldParticipants].toStringList();
 
213
 
 
214
    Participants participants = Participants::fromVariant(properties[FieldParticipants]);
214
215
    int count = properties[FieldCount].toInt();
215
216
    int unreadCount = properties[FieldUnreadCount].toInt();
216
217