[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:03 UTC 2016


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

The following commit has been merged in the master branch:
commit 4316858b1d897a00c334d9ed846c8dc3e99b2172
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date:   Wed Mar 20 13:31:00 2013 +0100

    Add small D-Bus interface to bring the window forward or close
    
    This is now used from the presence plasmoid, if the contact list
    is running, it calls the toggleWindowVisibility() and decides
    itself if it should bring the window forward or be closed.
    
    REVIEW: 109600
    CCBUG: 294991
---
 main-widget.cpp | 10 ++++++++++
 main-widget.h   |  4 ++++
 2 files changed, 14 insertions(+)

diff --git a/main-widget.cpp b/main-widget.cpp
index 90093be..92ff083 100644
--- a/main-widget.cpp
+++ b/main-widget.cpp
@@ -58,6 +58,7 @@
 #include <KToolInvocation>
 #include <KMenuBar>
 #include <KStandardAction>
+#include <KWindowSystem>
 
 #include "ui_main-widget.h"
 #include "account-buttons-panel.h"
@@ -569,4 +570,13 @@ void MainWidget::setupActions(const KConfigGroup& guiConfigGroup)
                                                 shownContacts == QLatin1String("blocked")));
 }
 
+void MainWidget::toggleWindowVisibility()
+{
+    if (isActiveWindow()) {
+        close();
+    } else {
+        KWindowSystem::forceActiveWindow(this->effectiveWinId());
+    }
+}
+
 #include "main-widget.moc"
diff --git a/main-widget.h b/main-widget.h
index d72c970..8dab6e0 100644
--- a/main-widget.h
+++ b/main-widget.h
@@ -48,6 +48,9 @@ class KJob;
 class MainWidget : public KMainWindow, Ui::MainWindow
 {
     Q_OBJECT
+    //this is needed otherwise this class is exported as .ktp-contactlist interface
+    //and dashes are not allowed in dbus interface names, so this interface would not work otherwise
+    Q_CLASSINFO("D-Bus Interface", "org.kde.KTp.ContactList")
 public:
     MainWidget(QWidget *parent = 0);
     ~MainWidget();
@@ -74,6 +77,7 @@ public:
 public Q_SLOTS:
     void showMessageToUser(const QString &text, const SystemMessageType type);
     void goOffline();
+    Q_INVOKABLE void toggleWindowVisibility();
 
 private Q_SLOTS:
     void toggleSearchWidget(bool show);

-- 
ktp-contact-list packaging



More information about the pkg-kde-commits mailing list