[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:33 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=d448a78
The following commit has been merged in the master branch:
commit d448a78f2956fa7f6fc422eb5a9aaa859feabbd2
Author: Aleix Pol <aleixpol at kde.org>
Date: Tue Mar 5 02:00:01 2013 +0100
Expose KTp::Actions into the declarative module
This way all plugins have a centralized way to do these common actions in
KTP
REVIEW: 109165
---
KTp/Declarative/CMakeLists.txt | 1 +
KTp/Declarative/declarative-ktp-actions.cpp | 50 +++++++++++++++++++++++++++
KTp/Declarative/declarative-ktp-actions.h | 52 +++++++++++++++++++++++++++++
KTp/Declarative/qml-plugins.cpp | 2 ++
4 files changed, 105 insertions(+)
diff --git a/KTp/Declarative/CMakeLists.txt b/KTp/Declarative/CMakeLists.txt
index 3865c13..32ec1c6 100644
--- a/KTp/Declarative/CMakeLists.txt
+++ b/KTp/Declarative/CMakeLists.txt
@@ -15,6 +15,7 @@ set (ktp_qml_plugin_SRCS
pinned-contacts-model.cpp
filtered-pinned-contacts-proxy-model.cpp
contact-pin.cpp
+ declarative-ktp-actions.cpp
qml-plugins.cpp
)
diff --git a/KTp/Declarative/declarative-ktp-actions.cpp b/KTp/Declarative/declarative-ktp-actions.cpp
new file mode 100644
index 0000000..4e8eeee
--- /dev/null
+++ b/KTp/Declarative/declarative-ktp-actions.cpp
@@ -0,0 +1,50 @@
+/*
+ Copyright (C) 2013 Aleix Pol <aleixpol at kde.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 "declarative-ktp-actions.h"
+#include <KTp/actions.h>
+
+void DeclarativeKTpActions::openLogViewer(const Tp::AccountPtr& account, const KTp::ContactPtr& contact)
+{
+ KTp::Actions::openLogViewer(account, contact);
+}
+
+Tp::PendingChannelRequest* DeclarativeKTpActions::startAudioCall(const Tp::AccountPtr& account, const KTp::ContactPtr& contact)
+{
+ return KTp::Actions::startAudioCall(account, contact);
+}
+
+Tp::PendingChannelRequest* DeclarativeKTpActions::startAudioVideoCall(const Tp::AccountPtr& account, const KTp::ContactPtr& contact)
+{
+ return KTp::Actions::startAudioVideoCall(account, contact);
+}
+
+Tp::PendingChannelRequest* DeclarativeKTpActions::startChat(const Tp::AccountPtr& account, const KTp::ContactPtr& contact, bool delegateToPreferredHandler)
+{
+ return KTp::Actions::startChat(account, contact, delegateToPreferredHandler);
+}
+
+Tp::PendingChannelRequest* DeclarativeKTpActions::startDesktopSharing(const Tp::AccountPtr& account, const KTp::ContactPtr& contact)
+{
+ return KTp::Actions::startDesktopSharing(account, contact);
+}
+
+Tp::PendingChannelRequest* DeclarativeKTpActions::startFileTransfer(const Tp::AccountPtr& account, const KTp::ContactPtr& contact, const QString& filePath)
+{
+ return KTp::Actions::startFileTransfer(account, contact, filePath);
+}
diff --git a/KTp/Declarative/declarative-ktp-actions.h b/KTp/Declarative/declarative-ktp-actions.h
new file mode 100644
index 0000000..034bcd2
--- /dev/null
+++ b/KTp/Declarative/declarative-ktp-actions.h
@@ -0,0 +1,52 @@
+/*
+ Copyright (C) 2013 Aleix Pol <aleixpol at kde.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 DECLARATIVEKTPACTIONS_H
+#define DECLARATIVEKTPACTIONS_H
+
+#include <QObject>
+#include <TelepathyQt/Types>
+#include <KTp/contact.h>
+
+namespace Tp { class PendingChannelRequest; }
+
+class DeclarativeKTpActions : public QObject
+{
+ Q_OBJECT
+ public Q_SLOTS:
+ Tp::PendingChannelRequest* startChat(const Tp::AccountPtr &account,
+ const KTp::ContactPtr &contact,
+ bool delegateToPreferredHandler = true);
+
+ Tp::PendingChannelRequest* startAudioCall(const Tp::AccountPtr &account,
+ const KTp::ContactPtr &contact);
+
+ Tp::PendingChannelRequest* startAudioVideoCall(const Tp::AccountPtr &account,
+ const KTp::ContactPtr &contact);
+
+ Tp::PendingChannelRequest* startDesktopSharing(const Tp::AccountPtr &account,
+ const KTp::ContactPtr &contact);
+
+ Tp::PendingChannelRequest* startFileTransfer(const Tp::AccountPtr &account,
+ const KTp::ContactPtr &contact,
+ const QString &filePath);
+
+ void openLogViewer(const Tp::AccountPtr &account, const KTp::ContactPtr &contact);
+};
+
+#endif // DECLARATIVEKTPACTIONS_H
diff --git a/KTp/Declarative/qml-plugins.cpp b/KTp/Declarative/qml-plugins.cpp
index 7bf1c41..e754b25 100644
--- a/KTp/Declarative/qml-plugins.cpp
+++ b/KTp/Declarative/qml-plugins.cpp
@@ -33,6 +33,7 @@
#include "pinned-contacts-model.h"
#include "contact-pin.h"
#include "filtered-pinned-contacts-proxy-model.h"
+#include "declarative-ktp-actions.h"
#include "Models/contacts-filter-model.h"
@@ -45,6 +46,7 @@ void QmlPlugins::registerTypes(const char *uri)
qmlRegisterType<PinnedContactsModel>(uri, 0, 1, "PinnedContactsModel");
qmlRegisterType<ContactPin>(uri, 0, 1, "ContactPin");
qmlRegisterType<FilteredPinnedContactsProxyModel>(uri, 0, 1, "FilteredPinnedContactsProxyModel");
+ qmlRegisterType<DeclarativeKTpActions>(uri, 0, 1, "DeclarativeKTpActions");
qmlRegisterUncreatableType<KTp::ContactsFilterModel> (uri, 0, 1, "AccountsFilterModel",
QLatin1String("Filter cannot be created. Access through ContactList.filter"));
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list