[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=d2b852e

The following commit has been merged in the master branch:
commit d2b852ec71e3b0a8d86af820b20522d7f975b2e2
Author: Dan Vrátil <dvratil at redhat.com>
Date:   Sun Sep 15 15:55:33 2013 +0200

    Deduplicate 'Open LogViewer...' in KPeople ActionsPlugin
    
    When user selects a person, only show the action once and use Nepomuk URI
    to identify the person.
    
    REVIEW: 112738
---
 KTp/actions.cpp                                  | 10 +++++++
 KTp/actions.h                                    |  2 ++
 kpeople/actionsplugin/kpeople-actions-plugin.cpp | 37 +++++++++++++++++-------
 3 files changed, 38 insertions(+), 11 deletions(-)

diff --git a/KTp/actions.cpp b/KTp/actions.cpp
index 15d284a..ec8a19e 100644
--- a/KTp/actions.cpp
+++ b/KTp/actions.cpp
@@ -201,6 +201,16 @@ void Actions::openLogViewer(const Tp::AccountPtr &account,
     KToolInvocation::kdeinitExec(QLatin1String("ktp-log-viewer"), arguments);
 }
 
+void Actions::openLogViewer(const QUrl &uri)
+{
+    kDebug() << "Opening logviewer for" << uri;
+
+    QStringList arguments;
+    arguments << QLatin1String("--") << uri.toString();
+
+    KToolInvocation::kdeinitExec(QLatin1String("ktp-log-viewer"), arguments);
+}
+
 const QVariantMap createHintsForCollabRequest(const Actions::DocumentList& documents, bool needOpenEditor)
 {
     QVariantMap hints;
diff --git a/KTp/actions.h b/KTp/actions.h
index 4a2bd54..85d43dc 100644
--- a/KTp/actions.h
+++ b/KTp/actions.h
@@ -77,6 +77,8 @@ namespace Actions {
     KTP_EXPORT void openLogViewer(const Tp::AccountPtr &account,
                                   const Tp::ContactPtr &contact);
 
+    KTP_EXPORT void openLogViewer(const QUrl &uri);
+
 
 } /* namespace Actions */
 
diff --git a/kpeople/actionsplugin/kpeople-actions-plugin.cpp b/kpeople/actionsplugin/kpeople-actions-plugin.cpp
index 599a016..f5f8382 100644
--- a/kpeople/actionsplugin/kpeople-actions-plugin.cpp
+++ b/kpeople/actionsplugin/kpeople-actions-plugin.cpp
@@ -49,12 +49,16 @@ class IMAction : public QAction {
 public:
     IMAction(const QString &text, const KIcon &icon, const KTp::ContactPtr &contact,
              const Tp::AccountPtr &account, IMActionType type, QObject *parent);
+    IMAction(const QString &text, const KIcon &icon, const QUrl &uri,
+             IMActionType type, QObject *parent);
     KTp::ContactPtr contact() const;
     Tp::AccountPtr account() const;
     IMActionType type() const;
+    QUrl uri() const;
 private:
     KTp::ContactPtr m_contact;
     Tp::AccountPtr m_account;
+    QUrl m_uri;
     IMActionType m_type;
 };
 
@@ -67,6 +71,14 @@ IMAction::IMAction(const QString &text, const KIcon &icon, const KTp::ContactPtr
 {
 }
 
+IMAction::IMAction(const QString &text, const KIcon &icon, const QUrl &uri,
+                   IMActionType type, QObject *parent):
+    QAction(icon, text, parent),
+    m_uri(uri),
+    m_type(type)
+{
+}
+
 KTp::ContactPtr IMAction::contact() const
 {
     return m_contact;
@@ -77,12 +89,16 @@ Tp::AccountPtr IMAction::account() const
     return m_account;
 }
 
-
 IMActionType IMAction::type() const
 {
     return m_type;
 }
 
+QUrl IMAction::uri() const
+{
+    return m_uri;
+}
+
 KPeopleActionsPlugin::KPeopleActionsPlugin(QObject* parent, const QVariantList &args):
 AbstractPersonPlugin(parent)
 {
@@ -153,16 +169,15 @@ QList<QAction*> KPeopleActionsPlugin::actionsForPerson(const KPeople::PersonData
             connect (action, SIGNAL(triggered(bool)), SLOT(onActionTriggered()));
             actions << action;
         }
-
-        QAction *action = new IMAction(i18n("Open Log Viewer..."),
-                                    KIcon(QLatin1String("documentation")),
-                                    contact,
-                                    account,
-                                    LogViewer,
-                                    parent);
-        connect(action, SIGNAL(triggered(bool)), SLOT(onActionTriggered()));
-        actions << action;
     }
+
+    QAction *action = new IMAction(i18n("Open Log Viewer..."),
+                                   KIcon(QLatin1String("documentation")),
+                                   personData->uri(),
+                                   LogViewer,
+                                   parent);
+    connect(action, SIGNAL(triggered(bool)), SLOT(onActionTriggered()));
+    actions << action;
     return actions;
 }
 
@@ -187,7 +202,7 @@ void KPeopleActionsPlugin::onActionTriggered()
             //TODO: add filetransfer
             break;
         case LogViewer:
-            KTp::Actions::openLogViewer(account, contact);
+            KTp::Actions::openLogViewer(action->uri());
             break;
     }
 }

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list