[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:07:08 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=df89bca
The following commit has been merged in the master branch:
commit df89bca7db6c8c870484b6810ec0d1713932f47d
Author: Sven Brauch <svenbrauch at googlemail.com>
Date: Wed Sep 18 19:19:01 2013 +0200
Add the collaborative editing action to KPeople plugin.
REVIEW:112799
---
KTp/contact.cpp | 11 +++++++++++
KTp/contact.h | 2 ++
kpeople/actionsplugin/CMakeLists.txt | 1 +
kpeople/actionsplugin/kpeople-actions-plugin.cpp | 19 ++++++++++++++++++-
4 files changed, 32 insertions(+), 1 deletion(-)
diff --git a/KTp/contact.cpp b/KTp/contact.cpp
index c9f857b..5bf3519 100644
--- a/KTp/contact.cpp
+++ b/KTp/contact.cpp
@@ -95,6 +95,17 @@ bool KTp::Contact::fileTransferCapability() const
return false;
}
+bool KTp::Contact::collaborativeEditingCapability() const
+{
+ if (! manager()->connection()) {
+ return false;
+ }
+ const QString collab(QLatin1String("infinote"));
+ bool selfCanShare = manager()->connection()->selfContact()->capabilities().streamTubes(collab);
+ bool otherCanShare = capabilities().streamTubes(collab);
+ return selfCanShare && otherCanShare;
+}
+
QStringList KTp::Contact::clientTypes() const
{
/* Temporary workaround for upstream bug https://bugs.freedesktop.org/show_bug.cgi?id=55883)
diff --git a/KTp/contact.h b/KTp/contact.h
index 7173686..05bcf00 100644
--- a/KTp/contact.h
+++ b/KTp/contact.h
@@ -41,6 +41,8 @@ public:
bool videoCallCapability() const;
/** Returns true if file transfers can be started with this contact*/
bool fileTransferCapability() const;
+ /** Returns true if this contact supports collaborative editing*/
+ bool collaborativeEditingCapability() const;
//Overridden as a workaround for upstream bug https://bugs.freedesktop.org/show_bug.cgi?id=55883
QStringList clientTypes() const;
diff --git a/kpeople/actionsplugin/CMakeLists.txt b/kpeople/actionsplugin/CMakeLists.txt
index 3f2bc9a..3198c3c 100644
--- a/kpeople/actionsplugin/CMakeLists.txt
+++ b/kpeople/actionsplugin/CMakeLists.txt
@@ -13,6 +13,7 @@ target_link_libraries (ktp_kpeople_plugin
${TELEPATHY_QT4_LIBRARIES}
${KDE4_KDEUI_LIBS}
${KPEOPLE_LIBS}
+ ${KDE4_KFILE_LIBS}
ktpcommoninternalsprivate
)
diff --git a/kpeople/actionsplugin/kpeople-actions-plugin.cpp b/kpeople/actionsplugin/kpeople-actions-plugin.cpp
index f5f8382..4fbaa08 100644
--- a/kpeople/actionsplugin/kpeople-actions-plugin.cpp
+++ b/kpeople/actionsplugin/kpeople-actions-plugin.cpp
@@ -23,6 +23,7 @@
#include <KIcon>
#include <KLocalizedString>
#include <KPluginFactory>
+#include <KFileDialog>
#include <kdemacros.h>
#include "KTp/contact.h"
@@ -41,7 +42,8 @@ enum IMActionType {
AudioChannel,
VideoChannel,
FileTransfer,
- LogViewer
+ LogViewer,
+ CollabEditing
};
class IMAction : public QAction {
@@ -169,6 +171,16 @@ QList<QAction*> KPeopleActionsPlugin::actionsForPerson(const KPeople::PersonData
connect (action, SIGNAL(triggered(bool)), SLOT(onActionTriggered()));
actions << action;
}
+ if (contact->collaborativeEditingCapability()) {
+ QAction *action = new IMAction(i18n("Collaboratively edit a document Using %1...", account->displayName()),
+ KIcon(QLatin1String("document-edit")),
+ contact,
+ account,
+ CollabEditing,
+ parent);
+ connect (action, SIGNAL(triggered(bool)), SLOT(onActionTriggered()));
+ actions << action;
+ }
}
QAction *action = new IMAction(i18n("Open Log Viewer..."),
@@ -204,6 +216,11 @@ void KPeopleActionsPlugin::onActionTriggered()
case LogViewer:
KTp::Actions::openLogViewer(action->uri());
break;
+ case CollabEditing: {
+ const KUrl file = KUrl(KFileDialog::getOpenFileName());
+ KTp::Actions::startCollaborativeEditing(account, contact, QList<KUrl>() << file, true);
+ break;
+ }
}
}
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list