summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Klapetek <mklapetek@kde.org>2016-02-11 03:16:10 (GMT)
committerAlexandr Akulich <akulichalexander@gmail.com>2016-09-21 13:05:33 (GMT)
commit46e4a5b716bf3a0d69dc8e9dc41d6fcbd5ff7911 (patch)
tree114980ffd3efe70660997cf8405ce1ebc6f34fae
parent1c6ebe036bfd641c7f147faabc1b76fe2d32c762 (diff)
[declarative] Create MessagesModel on setting new text channel
Reviewed-by: Alexandr Akulich <akulichalexander@gmail.com>
-rw-r--r--KTp/Declarative/conversation.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/KTp/Declarative/conversation.cpp b/KTp/Declarative/conversation.cpp
index 6199cac..d162dd2 100644
--- a/KTp/Declarative/conversation.cpp
+++ b/KTp/Declarative/conversation.cpp
@@ -80,6 +80,9 @@ Conversation::Conversation(QObject *parent) : QObject(parent)
void Conversation::setTextChannel(const Tp::TextChannelPtr& channel)
{
+ if (!d->messages) {
+ d->messages = new MessagesModel(d->account, this);
+ }
if (d->messages->textChannel() != channel) {
d->messages->setTextChannel(channel);
d->valid = channel->isValid();