[SCM] ktp-contact-applet packaging branch, master, updated. debian/15.12.1-1-966-gde83ac5

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:19:41 UTC 2016


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

The following commit has been merged in the master branch:
commit 9b3161f2d997354541ef75f87d7d335109818f0f
Author: Aleix Pol <aleixpol at kde.org>
Date:   Sat Feb 21 20:09:34 2015 +0100

    Create a qml plugin for chat-specific stuff
---
 CMakeLists.txt                                     |  3 +-
 chat/CMakeLists.txt                                |  1 +
 chat/org.kde.ktp-chat/contents/ui/FullChatList.qml |  3 +-
 chat/qmlplugin/CMakeLists.txt                      | 10 +++++++
 .../hide-window-component.cpp}                     | 24 ++++++++--------
 .../hide-window-component.h}                       | 33 ++++++++++++++--------
 chat/qmlplugin/qmldir                              |  4 +++
 .../ActionDelegate.qml => qmlplugin/qmlplugin.cpp} | 31 ++++++++++++--------
 8 files changed, 72 insertions(+), 37 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b426230..1f39254 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,7 +5,8 @@ cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
 find_package(ECM 0.0.11 REQUIRED NO_MODULE)
 set (CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
 
-find_package(KF5 REQUIRED COMPONENTS Plasma)
+find_package(Qt5 REQUIRED COMPONENTS Qml)
+find_package(KF5 REQUIRED COMPONENTS Plasma WindowSystem)
 
 include(KDEInstallDirs)
 include(KDECMakeSettings)
diff --git a/chat/CMakeLists.txt b/chat/CMakeLists.txt
index 4a0fa6c..1bf060a 100644
--- a/chat/CMakeLists.txt
+++ b/chat/CMakeLists.txt
@@ -7,3 +7,4 @@ install(DIRECTORY org.kde.ktp-chat DESTINATION ${PLASMA_DATA_INSTALL_DIR}/plasmo
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.ktp-chat/metadata.desktop DESTINATION ${PLASMA_DATA_INSTALL_DIR}/plasmoids/org.kde.ktp-chat/)
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.ktp-chat/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME plasma-applet-ktp-chat.desktop)
 
+add_subdirectory(qmlplugin)
diff --git a/chat/org.kde.ktp-chat/contents/ui/FullChatList.qml b/chat/org.kde.ktp-chat/contents/ui/FullChatList.qml
index 8a7d7ec..1a265c4 100644
--- a/chat/org.kde.ktp-chat/contents/ui/FullChatList.qml
+++ b/chat/org.kde.ktp-chat/contents/ui/FullChatList.qml
@@ -21,6 +21,7 @@
 import QtQuick 2.1
 import QtQuick.Layouts 1.1
 import org.kde.telepathy 0.1 as KTp
+import org.kde.ktpchat 0.1 as KTpChat
 import org.kde.plasma.components 2.0 as PlasmaComponents
 import org.kde.plasma.core 2.0 as PlasmaCore
 import org.kde.kquickcontrolsaddons 2.0 as ExtraComponents
@@ -64,7 +65,7 @@ Grid {
         id: conversationsModel
     }
 
-    KTp.HideWindowComponent {
+    KTpChat.HideWindowComponent {
         id: windowHide
     }
 
diff --git a/chat/qmlplugin/CMakeLists.txt b/chat/qmlplugin/CMakeLists.txt
new file mode 100644
index 0000000..52e79a0
--- /dev/null
+++ b/chat/qmlplugin/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_library (ktpchatplugin SHARED hide-window-component.cpp qmlplugin.cpp)
+
+target_link_libraries (ktpchatplugin
+    Qt5::Qml
+    
+    KF5::WindowSystem
+)
+
+install (TARGETS ktpchatplugin DESTINATION ${QML_INSTALL_DIR}/org/kde/ktpchat)
+install (FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/ktpchat)
diff --git a/chat/org.kde.ktp-chat/contents/ui/OutgoingDelegate.qml b/chat/qmlplugin/hide-window-component.cpp
similarity index 68%
copy from chat/org.kde.ktp-chat/contents/ui/OutgoingDelegate.qml
copy to chat/qmlplugin/hide-window-component.cpp
index 2144b5a..bf8f24b 100644
--- a/chat/org.kde.ktp-chat/contents/ui/OutgoingDelegate.qml
+++ b/chat/qmlplugin/hide-window-component.cpp
@@ -1,7 +1,6 @@
 /*
-    Copyright (C) 2012  Lasath Fernando <kde at lasath.org>
-    Copyright (C) 2012 David Edmundson <kde at davidedmundson.co.uk>
-    
+    Copyright (C) 2012 Aleix Pol Gonzalez <aleixpol at blue-systems.com>
+
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     License as published by the Free Software Foundation; either
@@ -17,13 +16,16 @@
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */
 
-import QtQuick 2.1
+#include "hide-window-component.h"
+
+#include <KWindowSystem>
+
+HideWindowComponent::HideWindowComponent(QObject *parent)
+    : QObject(parent)
+{
+}
 
-TextDelegate {
-    Rectangle {
-        color: theme.viewBackgroundColor
-        anchors.fill: parent
-        z: parent.z-1
-        opacity: 0.7
-    }
+void HideWindowComponent::hideWindowFromTaskbar(qulonglong winId)
+{
+    KWindowSystem::setState(winId, NET::SkipTaskbar | NET::SkipPager);
 }
diff --git a/chat/org.kde.ktp-chat/contents/ui/ActionDelegate.qml b/chat/qmlplugin/hide-window-component.h
similarity index 59%
copy from chat/org.kde.ktp-chat/contents/ui/ActionDelegate.qml
copy to chat/qmlplugin/hide-window-component.h
index df9fbc3..78d0bff 100644
--- a/chat/org.kde.ktp-chat/contents/ui/ActionDelegate.qml
+++ b/chat/qmlplugin/hide-window-component.h
@@ -1,7 +1,6 @@
 /*
-    Copyright (C) 2012  Lasath Fernando <kde at lasath.org>
-    Copyright (C) 2012 David Edmundson <kde at davidedmundson.co.uk>
-    
+    Copyright (C) 2012 Aleix Pol Gonzalez <aleixpol at blue-systems.com>
+
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     License as published by the Free Software Foundation; either
@@ -17,13 +16,23 @@
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */
 
-import QtQuick 2.1
-import org.kde.plasma.components 2.0 as PlasmaComponents
-import org.kde.plasma.core 2.0 as PlasmaCore
-import org.kde.telepathy 0.1
+#ifndef HIDEWINDOWCOMPONENT_H
+#define HIDEWINDOWCOMPONENT_H
+
+#include <QObject>
+
+/**
+ * Plasma is not exposing such a feature to make its dialogs hidden from the taskbar,
+ * that's why we added that weird object
+ */
+
+class HideWindowComponent : public QObject
+{
+    Q_OBJECT
+  public:
+    explicit HideWindowComponent(QObject *parent = 0);
+
+    Q_SCRIPTABLE void hideWindowFromTaskbar(qulonglong winId);
+};
 
-PlasmaComponents.Label {
-    wrapMode: Text.Wrap
-    width: view.width
-    text: "<i>* " + model.senderAlias + " " + model.text + "</i>"
-}
+#endif // HIDEWINDOWCOMPONENT_H
diff --git a/chat/qmlplugin/qmldir b/chat/qmlplugin/qmldir
new file mode 100644
index 0000000..4c37cce
--- /dev/null
+++ b/chat/qmlplugin/qmldir
@@ -0,0 +1,4 @@
+module org.kde.ktpchat
+
+plugin ktpchatplugin
+
diff --git a/chat/org.kde.ktp-chat/contents/ui/ActionDelegate.qml b/chat/qmlplugin/qmlplugin.cpp
similarity index 57%
copy from chat/org.kde.ktp-chat/contents/ui/ActionDelegate.qml
copy to chat/qmlplugin/qmlplugin.cpp
index df9fbc3..71a6495 100644
--- a/chat/org.kde.ktp-chat/contents/ui/ActionDelegate.qml
+++ b/chat/qmlplugin/qmlplugin.cpp
@@ -1,7 +1,6 @@
 /*
-    Copyright (C) 2012  Lasath Fernando <kde at lasath.org>
-    Copyright (C) 2012 David Edmundson <kde at davidedmundson.co.uk>
-    
+    Copyright (C) 2013  Aleix Pol Gonzalez <aleixpol at kde.org>
+
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     License as published by the Free Software Foundation; either
@@ -17,13 +16,21 @@
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */
 
-import QtQuick 2.1
-import org.kde.plasma.components 2.0 as PlasmaComponents
-import org.kde.plasma.core 2.0 as PlasmaCore
-import org.kde.telepathy 0.1
+#include <QQmlExtensionPlugin>
+#include <qqml.h>
+#include "hide-window-component.h"
+
+class QmlPlugins : public QQmlExtensionPlugin
+{
+    Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
+
+    public:
+        virtual void initializeEngine(QQmlEngine */*engine*/, const char */*uri*/) {}
+        virtual void registerTypes(const char *uri) {
+            qmlRegisterType<HideWindowComponent>(uri, 0, 1, "HideWindowComponent");
+        }
+
+};
 
-PlasmaComponents.Label {
-    wrapMode: Text.Wrap
-    width: view.width
-    text: "<i>* " + model.senderAlias + " " + model.text + "</i>"
-}
+#include "qmlplugin.moc"

-- 
ktp-contact-applet packaging



More information about the pkg-kde-commits mailing list