[SCM] ktp-contact-applet packaging branch, master, updated. debian/16.04.2-1-67-g066859a

Maximiliano Curia maxy at moszumanska.debian.org
Tue Sep 12 14:08:31 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-desktop-applets.git;a=commitdiff;h=161c3e4

The following commit has been merged in the master branch:
commit 161c3e416d1de574eadc77fe929ae3416612b606
Author: James D. Smith <smithjd15 at gmail.com>
Date:   Thu Jan 5 00:58:23 2017 -0700

    Register the contact applet on DBus.
    REVIEW: 127359
---
 CMakeLists.txt                                           |  2 +-
 contactlist/CMakeLists.txt                               |  2 ++
 contactlist/org.kde.ktp-contactlist/contents/ui/main.qml |  5 +++++
 contactlist/qmlplugin/CMakeLists.txt                     | 10 ++++++++++
 contactlist/qmlplugin/qmldir                             |  4 ++++
 {chat => contactlist}/qmlplugin/qmlplugin.cpp            | 13 +++----------
 .../qmlplugin/register-contact-applet.cpp                | 13 +++++++------
 .../qmlplugin/register-contact-applet.h                  | 16 ++++++++--------
 8 files changed, 40 insertions(+), 25 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index dc102d2..93f3dd5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,7 +12,7 @@ set(KTP_DESKTOP_APPLETS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICA
 find_package(ECM 0.0.11 REQUIRED NO_MODULE)
 set (CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
 
-find_package(Qt5 REQUIRED COMPONENTS Qml)
+find_package(Qt5 REQUIRED COMPONENTS Qml DBus)
 find_package(KF5 REQUIRED COMPONENTS Plasma WindowSystem)
 
 include(KDEInstallDirs)
diff --git a/contactlist/CMakeLists.txt b/contactlist/CMakeLists.txt
index 7279d01..71da560 100644
--- a/contactlist/CMakeLists.txt
+++ b/contactlist/CMakeLists.txt
@@ -5,3 +5,5 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/org.kde.ktp-contactlist/metadata.desk
 install(DIRECTORY org.kde.ktp-contactlist DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids PATTERN metadata.desktop.cmake EXCLUDE)
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.ktp-contactlist/metadata.desktop DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/org.kde.ktp-contactlist)
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.ktp-contactlist/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME plasma-applet-org.kde.ktp-contactlist.desktop)
+
+add_subdirectory(qmlplugin)
\ No newline at end of file
diff --git a/contactlist/org.kde.ktp-contactlist/contents/ui/main.qml b/contactlist/org.kde.ktp-contactlist/contents/ui/main.qml
index cc4a7ba..98ea64c 100644
--- a/contactlist/org.kde.ktp-contactlist/contents/ui/main.qml
+++ b/contactlist/org.kde.ktp-contactlist/contents/ui/main.qml
@@ -21,6 +21,7 @@
 import QtQuick 2.1
 import org.kde.telepathy 0.1 as KTp
 import org.kde.plasma.plasmoid 2.0
+import org.kde.ktpcontactlist 0.1 as KTpContactList
 
 Item
 {
@@ -34,6 +35,10 @@ Item
     Plasmoid.icon: ktpPresence.currentPresenceIconName
     Plasmoid.busy: ktpPresence.isChangingPresence
 
+    KTpContactList.RegisterContactApplet {
+        id: registerApplet
+    }
+
     KTp.PresenceModel {
         id: presenceModel
     }
diff --git a/contactlist/qmlplugin/CMakeLists.txt b/contactlist/qmlplugin/CMakeLists.txt
new file mode 100644
index 0000000..92899ec
--- /dev/null
+++ b/contactlist/qmlplugin/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_library (ktpcontactlistplugin SHARED register-contact-applet.cpp qmlplugin.cpp)
+
+target_link_libraries (ktpcontactlistplugin
+    Qt5::Qml
+
+    Qt5::DBus
+)
+
+install (TARGETS ktpcontactlistplugin DESTINATION ${QML_INSTALL_DIR}/org/kde/ktpcontactlist)
+install (FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/ktpcontactlist)
diff --git a/contactlist/qmlplugin/qmldir b/contactlist/qmlplugin/qmldir
new file mode 100644
index 0000000..9540172
--- /dev/null
+++ b/contactlist/qmlplugin/qmldir
@@ -0,0 +1,4 @@
+module org.kde.ktpcontactlist
+
+plugin ktpcontactlistplugin
+
diff --git a/chat/qmlplugin/qmlplugin.cpp b/contactlist/qmlplugin/qmlplugin.cpp
similarity index 72%
copy from chat/qmlplugin/qmlplugin.cpp
copy to contactlist/qmlplugin/qmlplugin.cpp
index eb1fce6..746641e 100644
--- a/chat/qmlplugin/qmlplugin.cpp
+++ b/contactlist/qmlplugin/qmlplugin.cpp
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013  Aleix Pol Gonzalez <aleixpol at kde.org>
+    Copyright (C) 2016 James D. Smith <smithjd15 at gmail.com>
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
@@ -18,13 +18,7 @@
 
 #include <QQmlExtensionPlugin>
 #include <qqml.h>
-#include "hide-window-component.h"
-#include "htmlhelper.h"
-
-static QObject *htmlHelper_singleton_provider(QQmlEngine *, QJSEngine *)
-{
-    return new HtmlHelper();
-}
+#include "register-contact-applet.h"
 
 class QmlPlugins : public QQmlExtensionPlugin
 {
@@ -34,8 +28,7 @@ class QmlPlugins : public QQmlExtensionPlugin
     public:
         virtual void initializeEngine(QQmlEngine */*engine*/, const char */*uri*/) {}
         virtual void registerTypes(const char *uri) {
-            qmlRegisterType<HideWindowComponent>(uri, 0, 1, "HideWindowComponent");
-            qmlRegisterSingletonType<HtmlHelper>(uri, 0, 1, "HtmlHelper", htmlHelper_singleton_provider);
+            qmlRegisterType<RegisterContactApplet>(uri, 0, 1, "RegisterContactApplet");
         }
 
 };
diff --git a/chat/qmlplugin/hide-window-component.cpp b/contactlist/qmlplugin/register-contact-applet.cpp
similarity index 63%
copy from chat/qmlplugin/hide-window-component.cpp
copy to contactlist/qmlplugin/register-contact-applet.cpp
index bf8f24b..fcb183a 100644
--- a/chat/qmlplugin/hide-window-component.cpp
+++ b/contactlist/qmlplugin/register-contact-applet.cpp
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012 Aleix Pol Gonzalez <aleixpol at blue-systems.com>
+    Copyright (C) 2016 James D. Smith <smithjd15 at gmail.com>
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
@@ -16,16 +16,17 @@
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */
 
-#include "hide-window-component.h"
+#include "register-contact-applet.h"
 
-#include <KWindowSystem>
+#include <QtDBus/QDBusConnection>
 
-HideWindowComponent::HideWindowComponent(QObject *parent)
+RegisterContactApplet::RegisterContactApplet(QObject *parent)
     : QObject(parent)
 {
+    QDBusConnection::sessionBus().registerService(QLatin1String("org.kde.Telepathy.PresenceApplet"));
 }
 
-void HideWindowComponent::hideWindowFromTaskbar(qulonglong winId)
+RegisterContactApplet::~RegisterContactApplet()
 {
-    KWindowSystem::setState(winId, NET::SkipTaskbar | NET::SkipPager);
+    QDBusConnection::sessionBus().unregisterService(QLatin1String("org.kde.Telepathy.PresenceApplet"));
 }
diff --git a/chat/qmlplugin/htmlhelper.h b/contactlist/qmlplugin/register-contact-applet.h
similarity index 73%
copy from chat/qmlplugin/htmlhelper.h
copy to contactlist/qmlplugin/register-contact-applet.h
index 76082ae..b09c625 100644
--- a/chat/qmlplugin/htmlhelper.h
+++ b/contactlist/qmlplugin/register-contact-applet.h
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2016 Kai Uwe Broulik <kde at privat.broulik.de>
+    Copyright (C) 2016 James D. Smith <smithjd15 at gmail.com>
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
@@ -16,18 +16,18 @@
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */
 
-#pragma once
+#ifndef REGISTERCONTACTAPPLET_H
+#define REGISTERCONTACTAPPLET_H
 
 #include <QObject>
 
-class HtmlHelper : public QObject
+class RegisterContactApplet : public QObject
 {
     Q_OBJECT
-
   public:
-    explicit HtmlHelper(QObject *parent = nullptr);
-    ~HtmlHelper() override;
-
-    Q_INVOKABLE QString decode(const QString &text) const;
+    explicit RegisterContactApplet(QObject *parent = 0);
+    ~RegisterContactApplet();
 
 };
+
+#endif // REGISTERCONTACTAPPLET_H

-- 
ktp-contact-applet packaging



More information about the pkg-kde-commits mailing list