[SCM] ktp-contact-list packaging branch, master, updated. debian/15.12.1-2-1070-g6c56f91

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:13:31 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=94d1164

The following commit has been merged in the master branch:
commit 94d116487dad42db4681d0d63be584a031a15d8b
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date:   Wed Jul 3 00:38:32 2013 +0200

    Add KPeople context menu based on person actions; brings optional KPeople dep
    
    Reviewed-by: David Edmundson
---
 CMakeLists.txt   |  9 +++++++++
 context-menu.cpp | 25 ++++++++++++++++++-------
 main-widget.cpp  |  2 +-
 3 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 40aa3fd..6fdd34e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,6 +13,14 @@ find_package (KDE4 4.4.75 REQUIRED)
 find_package (TelepathyQt4 0.9.3 REQUIRED)
 find_package (KTp REQUIRED)
 find_package (TelepathyLoggerQt4 0.5.60 REQUIRED)
+find_package (KPeople)
+
+macro_log_feature(KPEOPLE_FOUND "KPeople" "Support for KDE Contact Aggregation" "https://projects.kde.org/libkpeople" FALSE "" "")
+macro_display_feature_log()
+
+if (KPEOPLE_FOUND)
+    add_definitions(-DHAVE_KPEOPLE)
+endif (KPEOPLE_FOUND)
 
 include (KDE4Defaults)
 include (MacroLibrary)
@@ -77,6 +85,7 @@ target_link_libraries (ktp-contactlist
                        ${KDE4_KCMUTILS_LIBS}
                        ${TELEPATHY_LOGGER_QT4_LIBRARIES}
                        ${KDE4_KNOTIFYCONFIG_LIBS}
+                       kpeople
 )
 
 
diff --git a/context-menu.cpp b/context-menu.cpp
index 5645340..a48b10a 100644
--- a/context-menu.cpp
+++ b/context-menu.cpp
@@ -44,6 +44,10 @@
 #include <TelepathyLoggerQt4/LogManager>
 #include <TelepathyLoggerQt4/Init>
 
+#ifdef HAVE_KPEOPLE
+#include <kpeople/personpluginmanager.h>
+#endif
+
 #include "dialogs/remove-contact-dialog.h"
 
 #include "contact-list-widget_p.h"
@@ -98,8 +102,14 @@ KMenu* ContextMenu::contactContextMenu(const QModelIndex &index)
     KMenu *menu = new KMenu();
     menu->addTitle(contact->alias());
 
+    QAction *action;
+
+#ifdef HAVE_KPEOPLE
+    menu->addActions(KPeople::PersonPluginManager::actionsForPerson(
+        KPeople::PersonData::createFromUri(index.data(KTp::NepomukUriRole).toString()), menu));
+#else
     //must be a QAction because menu->addAction returns QAction, breaks compilation otherwise
-    QAction *action = menu->addAction(i18n("Start Chat..."));
+    action = menu->addAction(i18n("Start Chat..."));
     action->setIcon(KIcon("text-x-generic"));
     action->setDisabled(true);
     connect(action, SIGNAL(triggered(bool)),
@@ -109,12 +119,6 @@ KMenu* ContextMenu::contactContextMenu(const QModelIndex &index)
         action->setEnabled(true);
     }
 
-    Tp::ConnectionPtr accountConnection = account->connection();
-    if (accountConnection.isNull()) {
-        kDebug() << "Account connection is nulled.";
-        return 0;
-    }
-
     action = menu->addAction(i18n("Start Audio Call..."));
     action->setIcon(KIcon("audio-headset"));
     action->setDisabled(true);
@@ -165,6 +169,7 @@ KMenu* ContextMenu::contactContextMenu(const QModelIndex &index)
     if (m_logManager->exists(account, entity, Tpl::EventTypeMaskText)) {
         action->setEnabled(true);
     }
+#endif
 
     menu->addSeparator();
     action = menu->addAction(KIcon("dialog-information"), i18n("Configure Notifications..."));
@@ -196,6 +201,12 @@ KMenu* ContextMenu::contactContextMenu(const QModelIndex &index)
 
     menu->addSeparator();
 
+    Tp::ConnectionPtr accountConnection = account->connection();
+    if (accountConnection.isNull()) {
+        kDebug() << "Account connection is nulled.";
+        return 0;
+    }
+
     if (m_mainWidget->d_ptr->model->groupMode() == KTp::ContactsModel::GroupGrouping) {
         // remove contact from group action, must be QAction because menu->addAction returns QAction
         QAction *groupRemoveAction = menu->addAction(KIcon(), i18n("Remove Contact From This Group"));
diff --git a/main-widget.cpp b/main-widget.cpp
index 3f7db3e..b9129fa 100644
--- a/main-widget.cpp
+++ b/main-widget.cpp
@@ -257,7 +257,7 @@ void MainWidget::onCustomContextMenuRequested(const QPoint &pos)
 
     KMenu *menu = 0;
 
-    if (type == KTp::ContactRowType) {
+    if (type == KTp::ContactRowType || type == KTp::PersonRowType) {
         menu = m_contextMenu->contactContextMenu(index);
     } else if (type == KTp::GroupRowType) {
         menu = m_contextMenu->groupContextMenu(index);

-- 
ktp-contact-list packaging



More information about the pkg-kde-commits mailing list