[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=8576b80

The following commit has been merged in the master branch:
commit 8576b8054d76b004613102b655386700662bc2ec
Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Mon May 20 14:45:42 2013 +0100

    Do not remove conversation from model on validity changes
    
    REVIEW: 110552
---
 KTp/Declarative/conversation.cpp        | 14 ++++++++------
 KTp/Declarative/conversation.h          | 12 ++++++------
 KTp/Declarative/conversations-model.cpp | 12 ++----------
 KTp/Declarative/conversations-model.h   |  3 +--
 4 files changed, 17 insertions(+), 24 deletions(-)

diff --git a/KTp/Declarative/conversation.cpp b/KTp/Declarative/conversation.cpp
index 6820913..22da190 100644
--- a/KTp/Declarative/conversation.cpp
+++ b/KTp/Declarative/conversation.cpp
@@ -94,21 +94,23 @@ void Conversation::delegateToProperClient()
 {
     ChannelDelegator::delegateChannel(d->account, d->messages->textChannel());
     d->delegated = true;
-    Q_EMIT conversationDelegated();
+    Q_EMIT conversationCloseRequested();
 }
 
 void Conversation::requestClose()
 {
     kDebug();
-    //if we are not handling the channel do nothing.
-    if (!d->delegated) {
-        d->messages->textChannel()->requestClose();
-    }
+
+    //removing from the model will delete this object closing the channel
+    Q_EMIT conversationCloseRequested();
 }
 
 Conversation::~Conversation()
 {
     kDebug();
-    requestClose();
+    //if we are not handling the channel do nothing.
+    if (!d->delegated) {
+        d->messages->textChannel()->requestClose();
+    }
     delete d;
 }
diff --git a/KTp/Declarative/conversation.h b/KTp/Declarative/conversation.h
index 6fc8903..d088dff 100644
--- a/KTp/Declarative/conversation.h
+++ b/KTp/Declarative/conversation.h
@@ -39,7 +39,7 @@ class Conversation : public QObject
     Q_PROPERTY(MessagesModel *messages READ messages CONSTANT)
     Q_PROPERTY(bool valid READ isValid NOTIFY validityChanged)
 
-  public:
+public:
     Conversation(const Tp::TextChannelPtr &channel, const Tp::AccountPtr &account, QObject *parent = 0);
     Conversation(QObject *parent = 0);
     virtual ~Conversation();
@@ -49,18 +49,18 @@ class Conversation : public QObject
 
     bool isValid();
 
-  Q_SIGNALS:
+Q_SIGNALS:
     void validityChanged(bool isValid);
-    void conversationDelegated();
+    void conversationCloseRequested();
 
-  public Q_SLOTS:
+public Q_SLOTS:
     void delegateToProperClient();
     void requestClose();
 
-  private Q_SLOTS:
+private Q_SLOTS:
     void onChannelInvalidated(Tp::DBusProxy *proxy, const QString &errorName, const QString &errorMessage);
 
-  private:
+private:
     class ConversationPrivate;
     ConversationPrivate *d;
 };
diff --git a/KTp/Declarative/conversations-model.cpp b/KTp/Declarative/conversations-model.cpp
index 27bd35c..4200a35 100644
--- a/KTp/Declarative/conversations-model.cpp
+++ b/KTp/Declarative/conversations-model.cpp
@@ -136,8 +136,7 @@ void ConversationsModel::handleChannels(const Tp::MethodInvocationContextPtr<> &
         beginInsertRows(QModelIndex(), rowCount(), rowCount());
         Conversation *newConvo = new Conversation(textChannel, account, this);
         d->conversations.append(newConvo);
-        connect(newConvo, SIGNAL(validityChanged(bool)), SLOT(handleValidityChange(bool)));
-        connect(newConvo, SIGNAL(conversationDelegated()), SLOT(conversationDelegated()));
+        connect(newConvo, SIGNAL(conversationCloseRequested()), SLOT(onConversationCloseRequested()));
         connect(newConvo->messages(), SIGNAL(unreadCountChanged(int)), SIGNAL(totalUnreadCountChanged()));
         endInsertRows();
         context->setFinished();
@@ -150,14 +149,7 @@ bool ConversationsModel::bypassApproval() const
     return true;
 }
 
-void ConversationsModel::handleValidityChange(bool valid)
-{
-    if (!valid) {
-        removeConversation(qobject_cast<Conversation*>(QObject::sender()));
-    }
-}
-
-void ConversationsModel::conversationDelegated()
+void ConversationsModel::onConversationCloseRequested()
 {
     removeConversation(qobject_cast<Conversation*>(QObject::sender()));
 }
diff --git a/KTp/Declarative/conversations-model.h b/KTp/Declarative/conversations-model.h
index cb4d2e0..1691238 100644
--- a/KTp/Declarative/conversations-model.h
+++ b/KTp/Declarative/conversations-model.h
@@ -65,8 +65,7 @@ class ConversationsModel : public QAbstractListModel, public Tp::AbstractClientH
     ConversationsModelPrivate *d;
 
   private Q_SLOTS:
-    void handleValidityChange(bool);
-    void conversationDelegated();
+    void onConversationCloseRequested();
 
   Q_SIGNALS:
       void totalUnreadCountChanged();

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list