[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:20:46 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=a1d7d46

The following commit has been merged in the master branch:
commit a1d7d46e5356e7cbc11c536133eb545652a788a5
Author: Lasath Fernando <kde at lasath.org>
Date:   Sat Nov 12 03:39:19 2011 +1100

    implemented part of ConversationWatcher.
---
 lib/CMakeLists.txt                             |  6 ++-
 lib/conversation-watcher.cpp                   | 72 ++++++++++++++++++++++++++
 lib/{conversation.h => conversation-watcher.h} | 38 +++++++-------
 lib/conversation.cpp                           |  3 +-
 lib/conversation.h                             |  3 +-
 5 files changed, 99 insertions(+), 23 deletions(-)

diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 8ddb0be..4fdfdce 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -2,8 +2,9 @@ set(ktpchat_SRCS
         chat-widget.cpp
         chat-window-style.cpp
         chat-window-style-manager.cpp
-        conversation-model.cpp
         conversation.cpp
+        conversation-model.cpp
+        conversation-watcher.cpp
         adium-theme-view.cpp
         adium-theme-header-info.cpp
         adium-theme-message-info.cpp
@@ -26,8 +27,9 @@ set(ktpchat_HDRS
     chat-widget.h
     chat-window-style.h
     chat-window-style-manager.h
-    conversation-model.h
     conversation.h
+    conversation-model.h
+    conversation-watcher.h
 )
 
 set(ktpchat_PRETTY_HDRS
diff --git a/lib/conversation-watcher.cpp b/lib/conversation-watcher.cpp
new file mode 100644
index 0000000..bbe4d5f
--- /dev/null
+++ b/lib/conversation-watcher.cpp
@@ -0,0 +1,72 @@
+/*
+    <one line to give the library's name and an idea of what it does.>
+    Copyright (C) 2011  <copyright holder> <email>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+
+#include "conversation-watcher.h"
+
+#include <KDebug>
+
+#include <TelepathyQt4/ChannelClassSpec>
+#include <TelepathyQt4/TextChannel>
+#include "conversation.h"
+
+
+static inline Tp::ChannelClassSpecList channelClassList()
+{
+    return Tp::ChannelClassSpecList() << Tp::ChannelClassSpec::textChat()
+                                      << Tp::ChannelClassSpec::unnamedTextChat()
+                                      << Tp::ChannelClassSpec::textChatroom();
+}
+
+ConversationWatcher::ConversationWatcher() :
+	AbstractClientObserver(channelClassList())
+{
+
+}
+
+void ConversationWatcher::observeChannels(const Tp::MethodInvocationContextPtr<>& context,
+										  const Tp::AccountPtr& account,
+										  const Tp::ConnectionPtr& connection,
+										  const QList< Tp::ChannelPtr >& channels,
+										  const Tp::ChannelDispatchOperationPtr& dispatchOperation,
+										  const QList< Tp::ChannelRequestPtr >& requestsSatisfied,
+										  const Tp::AbstractClientObserver::ObserverInfo& observerInfo)
+{
+    kDebug();
+
+    Tp::TextChannelPtr textChannel;
+    Q_FOREACH(const Tp::ChannelPtr & channel, channels) {
+        textChannel = Tp::TextChannelPtr::dynamicCast(channel);
+        if (textChannel) {
+            break;
+        }
+    }
+
+    Q_ASSERT(textChannel);
+
+	Conversation con(textChannel, account);
+	newConversation(con);
+}
+
+ConversationWatcher::~ConversationWatcher()
+{
+
+}
+
+#include "moc_conversation-watcher.cpp"
\ No newline at end of file
diff --git a/lib/conversation.h b/lib/conversation-watcher.h
similarity index 51%
copy from lib/conversation.h
copy to lib/conversation-watcher.h
index a485e27..927441a 100644
--- a/lib/conversation.h
+++ b/lib/conversation-watcher.h
@@ -1,6 +1,6 @@
 /*
     <one line to give the library's name and an idea of what it does.>
-    Copyright (C) 2011  Lasath Fernando <kde at lasath.org>
+    Copyright (C) 2011  <copyright holder> <email>
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
@@ -18,31 +18,31 @@
 */
 
 
-#ifndef CONVERSATION_H
-#define CONVERSATION_H
+#ifndef CONVERSATION_WATCHER_H
+#define CONVERSATION_WATCHER_H
 
-#include <QObject>
-#include <TelepathyQt4/Types>
-#include "conversation-model.h"
+#include <TelepathyQt4/AbstractClient>
 
-class ConversationModel;
-class Conversation : public QObject
+class Conversation;
+
+class ConversationWatcher : public Tp::AbstractClientObserver , public QObject
 {
 Q_OBJECT
-Q_PROPERTY(const ConversationModel* model READ model NOTIFY modelChanged)
 
 public:
-    Conversation(Tp::TextChannelPtr channel, Tp::AccountPtr account);
-    virtual ~Conversation();
-
-	const ConversationModel* model() const;
+    virtual void observeChannels(const Tp::MethodInvocationContextPtr<>& context,
+								 const Tp::AccountPtr& account,
+								 const Tp::ConnectionPtr& connection,
+								 const QList< Tp::ChannelPtr >& channels,
+								 const Tp::ChannelDispatchOperationPtr& dispatchOperation,
+								 const QList< Tp::ChannelRequestPtr >& requestsSatisfied,
+								 const Tp::AbstractClientObserver::ObserverInfo& observerInfo
+								);
+    ConversationWatcher();
+    virtual ~ConversationWatcher();
 
 Q_SIGNALS:
-	void modelChanged(ConversationModel* newModel);
-
-private:
-	class ConversationPrivate;
-	ConversationPrivate *d;
+	void newConversation(Conversation&);
 };
 
-#endif // CONVERSATION_H
+#endif // CONVERSATION_WATCHER_H
diff --git a/lib/conversation.cpp b/lib/conversation.cpp
index e96fef6..f4a67c8 100644
--- a/lib/conversation.cpp
+++ b/lib/conversation.cpp
@@ -21,7 +21,8 @@
 #include "conversation.h"
 
 #include "conversation-model.h"
-#include <TelepathyQt4/Account>
+
+#include <TelepathyQt4/TextChannel>
 
 class Conversation::ConversationPrivate {
 public:
diff --git a/lib/conversation.h b/lib/conversation.h
index a485e27..2287a40 100644
--- a/lib/conversation.h
+++ b/lib/conversation.h
@@ -22,7 +22,8 @@
 #define CONVERSATION_H
 
 #include <QObject>
-#include <TelepathyQt4/Types>
+#include <TelepathyQt4/Account>
+#include <TelepathyQt4/TextChannel>
 #include "conversation-model.h"
 
 class ConversationModel;

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list