[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:04:48 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=90a2615
The following commit has been merged in the master branch:
commit 90a26152428a8742fb6283c94dddb80bc400b948
Author: Lasath Fernando <kde at lasath.org>
Date: Sat Nov 12 03:39:19 2011 +1100
implemented part of ConversationWatcher.
---
KTp/Declarative/conversation.cpp | 3 +-
KTp/Declarative/conversation.h | 3 +-
KTp/Declarative/telepathy-text-observer.cpp | 72 ++++++++++++++++++++++
.../{conversation.h => telepathy-text-observer.h} | 38 ++++++------
4 files changed, 95 insertions(+), 21 deletions(-)
diff --git a/KTp/Declarative/conversation.cpp b/KTp/Declarative/conversation.cpp
index e96fef6..f4a67c8 100644
--- a/KTp/Declarative/conversation.cpp
+++ b/KTp/Declarative/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/KTp/Declarative/conversation.h b/KTp/Declarative/conversation.h
index a485e27..2287a40 100644
--- a/KTp/Declarative/conversation.h
+++ b/KTp/Declarative/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;
diff --git a/KTp/Declarative/telepathy-text-observer.cpp b/KTp/Declarative/telepathy-text-observer.cpp
new file mode 100644
index 0000000..bbe4d5f
--- /dev/null
+++ b/KTp/Declarative/telepathy-text-observer.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/KTp/Declarative/conversation.h b/KTp/Declarative/telepathy-text-observer.h
similarity index 51%
copy from KTp/Declarative/conversation.h
copy to KTp/Declarative/telepathy-text-observer.h
index a485e27..927441a 100644
--- a/KTp/Declarative/conversation.h
+++ b/KTp/Declarative/telepathy-text-observer.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
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list