[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9
Maximiliano Curia
maxy at moszumanska.debian.org
Mon May 9 09:06:52 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=ef515f5
The following commit has been merged in the master branch:
commit ef515f5153eb3bdc4920e593360cd153034f6286
Author: David Edmundson <kde at davidedmundson.co.uk>
Date: Sat May 25 21:28:33 2013 +0100
Set the conversation to valid if a new TextChannel is set
REVIEW: 110682
---
KTp/Declarative/conversation.cpp | 20 +++++++++++++++-----
KTp/Declarative/conversation.h | 3 +++
KTp/Declarative/conversations-model.cpp | 6 +++---
3 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/KTp/Declarative/conversation.cpp b/KTp/Declarative/conversation.cpp
index 22da190..d7a8826 100644
--- a/KTp/Declarative/conversation.cpp
+++ b/KTp/Declarative/conversation.cpp
@@ -49,15 +49,11 @@ Conversation::Conversation(const Tp::TextChannelPtr &channel,
d->account = account;
d->messages = new MessagesModel(account, this);
- d->messages->setTextChannel(channel);
-
+ setTextChannel(channel);
d->target = new ConversationTarget(account, KTp::ContactPtr::qObjectCast(channel->targetContact()), this);
- d->valid = channel->isValid();
d->delegated = false;
- connect(channel.data(), SIGNAL(invalidated(Tp::DBusProxy*,QString,QString)),
- SLOT(onChannelInvalidated(Tp::DBusProxy*,QString,QString)));
}
Conversation::Conversation(QObject *parent) : QObject(parent)
@@ -66,6 +62,20 @@ Conversation::Conversation(QObject *parent) : QObject(parent)
Q_ASSERT(false);
}
+void Conversation::setTextChannel(const Tp::TextChannelPtr& channel)
+{
+ d->messages->setTextChannel(channel);
+ d->valid = channel->isValid();
+ connect(channel.data(), SIGNAL(invalidated(Tp::DBusProxy*,QString,QString)),
+ SLOT(onChannelInvalidated(Tp::DBusProxy*,QString,QString)));
+ Q_EMIT validityChanged(d->valid);
+}
+
+Tp::TextChannelPtr Conversation::textChannel() const
+{
+ return d->messages->textChannel();
+}
+
MessagesModel* Conversation::messages() const
{
return d->messages;
diff --git a/KTp/Declarative/conversation.h b/KTp/Declarative/conversation.h
index d088dff..fcd02f6 100644
--- a/KTp/Declarative/conversation.h
+++ b/KTp/Declarative/conversation.h
@@ -44,6 +44,9 @@ public:
Conversation(QObject *parent = 0);
virtual ~Conversation();
+ void setTextChannel(const Tp::TextChannelPtr &channel);
+ Tp::TextChannelPtr textChannel() const;
+
MessagesModel* messages() const;
ConversationTarget* target() const;
diff --git a/KTp/Declarative/conversations-model.cpp b/KTp/Declarative/conversations-model.cpp
index 4200a35..630d403 100644
--- a/KTp/Declarative/conversations-model.cpp
+++ b/KTp/Declarative/conversations-model.cpp
@@ -115,12 +115,12 @@ void ConversationsModel::handleChannels(const Tp::MethodInvocationContextPtr<> &
//if we are handling but should delegate, call delegate channel
Q_FOREACH(Conversation *convo, d->conversations) {
if (convo->target()->id() == textChannel->targetId() &&
- convo->messages()->textChannel()->targetHandleType() == textChannel->targetHandleType())
+ convo->textChannel()->targetHandleType() == textChannel->targetHandleType())
{
if (!shouldDelegate) {
- convo->messages()->setTextChannel(textChannel);
+ convo->setTextChannel(textChannel);
} else {
- if (convo->messages()->textChannel() == textChannel) {
+ if (convo->textChannel() == textChannel) {
convo->delegateToProperClient();
}
}
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list