[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=de1f5b8
The following commit has been merged in the master branch:
commit de1f5b85c35edb3524fc7904a1eeab1cd8ba7c36
Author: Lasath Fernando <kde at lasath.org>
Date: Sat Nov 12 02:46:13 2011 +1100
Implemented a basic Conversation class.
Also changed MessageItem from a struct to a class.
---
KTp/Declarative/conversation.cpp | 50 ++++++++++++++++++++++++++++++++++++++
KTp/Declarative/conversation.h | 48 ++++++++++++++++++++++++++++++++++++
KTp/Declarative/messages-model.cpp | 3 ++-
3 files changed, 100 insertions(+), 1 deletion(-)
diff --git a/KTp/Declarative/conversation.cpp b/KTp/Declarative/conversation.cpp
new file mode 100644
index 0000000..e96fef6
--- /dev/null
+++ b/KTp/Declarative/conversation.cpp
@@ -0,0 +1,50 @@
+/*
+ <one line to give the library's name and an idea of what it does.>
+ Copyright (C) 2011 Lasath Fernando <kde at lasath.org>
+
+ 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.h"
+
+#include "conversation-model.h"
+#include <TelepathyQt4/Account>
+
+class Conversation::ConversationPrivate {
+public:
+ ConversationModel* model;
+ Tp::AccountPtr account;
+};
+
+Conversation::Conversation(Tp::TextChannelPtr channel, Tp::AccountPtr account) :
+ d(new ConversationPrivate)
+{
+ d->model = new ConversationModel();
+ d->model->setTextChannel(channel);
+
+ d->account = account;
+}
+
+const ConversationModel* Conversation::model() const
+{
+ return d->model;
+}
+
+Conversation::~Conversation()
+{
+ delete d->model;
+}
+
diff --git a/KTp/Declarative/conversation.h b/KTp/Declarative/conversation.h
new file mode 100644
index 0000000..a485e27
--- /dev/null
+++ b/KTp/Declarative/conversation.h
@@ -0,0 +1,48 @@
+/*
+ <one line to give the library's name and an idea of what it does.>
+ Copyright (C) 2011 Lasath Fernando <kde at lasath.org>
+
+ 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
+*/
+
+
+#ifndef CONVERSATION_H
+#define CONVERSATION_H
+
+#include <QObject>
+#include <TelepathyQt4/Types>
+#include "conversation-model.h"
+
+class ConversationModel;
+class Conversation : 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;
+
+Q_SIGNALS:
+ void modelChanged(ConversationModel* newModel);
+
+private:
+ class ConversationPrivate;
+ ConversationPrivate *d;
+};
+
+#endif // CONVERSATION_H
diff --git a/KTp/Declarative/messages-model.cpp b/KTp/Declarative/messages-model.cpp
index 569d608..025af1d 100644
--- a/KTp/Declarative/messages-model.cpp
+++ b/KTp/Declarative/messages-model.cpp
@@ -23,7 +23,8 @@
#include <KDebug>
#include <TelepathyQt4/ReceivedMessage>
-struct MessageItem {
+class MessageItem {
+public:
QString user;
QString text;
QDateTime time;
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list