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


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

The following commit has been merged in the master branch:
commit 30f84c8f6afa698cabc0267ccc1b9890aaf0c2f0
Author: Francesco Nwokeka <francesco.nwokeka at gmail.com>
Date:   Tue Aug 16 20:10:25 2011 +0200

    Ported the plasmoid from pure QML to C++
    
    This has been done so that I can access nepomuk resources from a config file. This could not be done via QML.
---
 CMakeLists.txt                                     |  16 ++++---
 package/metadata.desktop                           |  22 ----------
 .../contents/ui => src/declarative}/Avatar.qml     |   0
 .../contents/ui => src/declarative}/Contact.qml    |   0
 {package/contents/ui => src/declarative}/main.qml  |   8 +---
 {package/contents => src}/frames/away.png          | Bin
 {package/contents => src}/frames/busy.png          | Bin
 {package/contents => src}/frames/offline.png       | Bin
 {package/contents => src}/frames/online.png        | Bin
 .../ui/Contact.qml => src/telepathyContact.cpp     |  46 ++++++++++++++-------
 .../ui/Contact.qml => src/telepathyContact.h       |  34 ++++++++-------
 telepathy-contact-applet.desktop                   |  18 ++++++++
 12 files changed, 79 insertions(+), 65 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 536c205..3739277 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,17 +1,21 @@
-project(telepathy-contact-applet)
+project(plasma_applet_telepathy_contact)
 
 cmake_minimum_required(VERSION 2.8)
 
 find_package(KDE4 REQUIRED)
+find_package(KDE4Workspace REQUIRED)
 
 include(KDE4Defaults)
 
-add_definitions(${KDE4_DEFINITIONS})
+add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
+include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES})
 
-include_directories(
-    ${KDE4_INCLUDES}
+set(telepathy_contact_applet_SRCS
+    src/telepathyContact.cpp
 )
 
-install(DIRECTORY package/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/org.kde.telepathy-contact PATTERN .git EXCLUDE PATTERN CMakeLists.txt EXCLUDE)
+kde4_add_plugin(plasma_applet_telepathy_contact ${telepathy_contact_applet_SRCS})
+target_link_libraries(plasma_applet_telepathy_contact ${KDE4_PLASMA_LIBS} ${KDE4_KDEUI_LIBS})
 
-install(FILES package/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME plasma-applet-telepathy-contact.desktop)
\ No newline at end of file
+install(TARGETS plasma_applet_telepathy_contact DESTINATION ${PLUGIN_INSTALL_DIR})
+install(FILES telepathy-contact-applet.desktop DESTINATION ${SERVICES_INSTALL_DIR})
\ No newline at end of file
diff --git a/package/metadata.desktop b/package/metadata.desktop
deleted file mode 100644
index a8669dd..0000000
--- a/package/metadata.desktop
+++ /dev/null
@@ -1,22 +0,0 @@
-[Desktop Entry]
-Name=Telepathy Contact
-Icon=telepathy-kde
-Type=Service
-
-X-Plasma-API=declarativeappletscript
-X-Plasma-MainScript=ui/main.qml
-X-Plasma-DefaultSize=128,128
-
-X-KDE-PluginInfo-Author=Francesco Nwokeka
-X-KDE-PluginInfo-Email=francesco.nwokeka at gmail.com
-X-KDE-PluginInfo-Website=http://telepathy.freedesktop.org/
-X-KDE-PluginInfo-Category=Online Services
-X-KDE-PluginInfo-Name=org.kde.telepathy-contact
-X-KDE-PluginInfo-Version=0.1
-
-X-KDE-PluginInfo-Depends=
-X-KDE-PluginInfo-License=GPL
-X-KDE-PluginInfo-EnabledByDefault=true
-X-KDE-ServiceTypes=Plasma/Applet,Plasma/PopupApplet
-
-X-Plasma-RequiredExtensions=LaunchApp,FileDialog
diff --git a/package/contents/ui/Avatar.qml b/src/declarative/Avatar.qml
similarity index 100%
rename from package/contents/ui/Avatar.qml
rename to src/declarative/Avatar.qml
diff --git a/package/contents/ui/Contact.qml b/src/declarative/Contact.qml
similarity index 100%
copy from package/contents/ui/Contact.qml
copy to src/declarative/Contact.qml
diff --git a/package/contents/ui/main.qml b/src/declarative/main.qml
similarity index 84%
rename from package/contents/ui/main.qml
rename to src/declarative/main.qml
index 88cdd1a..45a0828 100644
--- a/package/contents/ui/main.qml
+++ b/src/declarative/main.qml
@@ -18,12 +18,11 @@
  ***************************************************************************/
 
 import Qt 4.7
-import org.kde.plasma.graphicswidgets 0.1 as PlasmaWidgets
 
 Item {
     id: mainWidget;
 
-    // default contact size (also ni metadata file)
+    // default contact size (also ni metadata file) just to be sure
     width: 128;
     height: 128;
 
@@ -31,9 +30,4 @@ Item {
         id: contact;
         anchors.centerIn: parent;
     }
-
-    Component.onCompleted: {
-        // eliminates default plasmoid background leaving only the contact on the desktop
-        plasmoid.setBackgroundHints(NoBackground);
-    }
 }
diff --git a/package/contents/frames/away.png b/src/frames/away.png
similarity index 100%
rename from package/contents/frames/away.png
rename to src/frames/away.png
diff --git a/package/contents/frames/busy.png b/src/frames/busy.png
similarity index 100%
rename from package/contents/frames/busy.png
rename to src/frames/busy.png
diff --git a/package/contents/frames/offline.png b/src/frames/offline.png
similarity index 100%
rename from package/contents/frames/offline.png
rename to src/frames/offline.png
diff --git a/package/contents/frames/online.png b/src/frames/online.png
similarity index 100%
rename from package/contents/frames/online.png
rename to src/frames/online.png
diff --git a/package/contents/ui/Contact.qml b/src/telepathyContact.cpp
similarity index 58%
copy from package/contents/ui/Contact.qml
copy to src/telepathyContact.cpp
index 686cb23..1755b3f 100644
--- a/package/contents/ui/Contact.qml
+++ b/src/telepathyContact.cpp
@@ -17,24 +17,42 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
  ***************************************************************************/
 
-import Qt 4.7
+#include "telepathyContact.h"
 
-Item {
-    id: wrapper;
+#include <QtGui/QPainter>
+#include <QDebug>
 
-    // contact/person presence status
-    property string status: "offline";
+TelepathyContact::TelepathyContact(QObject* parent, const QVariantList& args)
+    : Plasma::Applet(parent, args)
+    , m_declarative(new Plasma::DeclarativeWidget(this))
+{
+    setBackgroundHints(NoBackground);
+    m_declarative->setGeometry(geometry());
 
-    anchors.fill: parent;
+    // user shouldn't be able to resize the plasmoid
+    setAspectRatioMode(Plasma::FixedSize);
+}
+
+TelepathyContact::~TelepathyContact()
+{
+
+}
 
-    Avatar{
-        id: avatar;
-        avatarPresenceStatus: wrapper.status;
+void TelepathyContact::init()
+{
+    Plasma::Applet::init();
 
-        anchors {
-            top: parent.top;
-            left: parent.left;
-            right: parent.right;
-        }
+    if (m_declarative) {
+        qDebug("setting declarative widget");
+        m_declarative->setQmlPath("../src/declarative/main.qml");
     }
 }
+
+void TelepathyContact::paintInterface(QPainter* p, const QStyleOptionGraphicsItem* option, const QRect& contentsRect)
+{
+    Plasma::Applet::paintInterface(p, option, contentsRect);
+}
+
+
+// This is the command that links your applet to the .desktop file
+K_EXPORT_PLASMA_APPLET(telepathy-contact, TelepathyContact)
\ No newline at end of file
diff --git a/package/contents/ui/Contact.qml b/src/telepathyContact.h
similarity index 73%
rename from package/contents/ui/Contact.qml
rename to src/telepathyContact.h
index 686cb23..895681a 100644
--- a/package/contents/ui/Contact.qml
+++ b/src/telepathyContact.h
@@ -17,24 +17,26 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
  ***************************************************************************/
 
-import Qt 4.7
+#ifndef TELEPATHY_CONTACT_H
+#define TELEPATHY_CONTACT_H
 
-Item {
-    id: wrapper;
+#include <KIcon>
 
-    // contact/person presence status
-    property string status: "offline";
+#include <Plasma/Applet>
+#include <Plasma/DeclarativeWidget>
 
-    anchors.fill: parent;
+class TelepathyContact: public Plasma::Applet
+{
+    Q_OBJECT
+public:
+    TelepathyContact(QObject *parent, const QVariantList &args);
+    ~TelepathyContact();
 
-    Avatar{
-        id: avatar;
-        avatarPresenceStatus: wrapper.status;
+    void init();
+    void paintInterface(QPainter *p, const QStyleOptionGraphicsItem *option, const QRect& contentsRect);
 
-        anchors {
-            top: parent.top;
-            left: parent.left;
-            right: parent.right;
-        }
-    }
-}
+private:
+    Plasma::DeclarativeWidget *m_declarative;
+};
+
+#endif  // TELEPATHY_CONTACT_H
\ No newline at end of file
diff --git a/telepathy-contact-applet.desktop b/telepathy-contact-applet.desktop
new file mode 100644
index 0000000..0d7c905
--- /dev/null
+++ b/telepathy-contact-applet.desktop
@@ -0,0 +1,18 @@
+[Desktop Entry]
+Name=Telepathy Contact
+Comment=telepathy contact applet
+Type=Service
+ServiceTypes=Plasma/Applet
+
+X-Plasma-DefaultSize=128,128
+
+X-KDE-Library=plasma_applet_telepathy_contact
+X-KDE-PluginInfo-Name=telepathy_contact
+X-KDE-PluginInfo-Category=
+X-KDE-PluginInfo-Author=Francesco Nwokeka
+X-KDE-PluginInfo-Email=francesco.nwokeka at gmail.com
+X-KDE-PluginInfo-Version=0.1
+X-KDE-PluginInfo-Website=http://telepathy.freedesktop.org/
+X-KDE-PluginInfo-Depends=
+X-KDE-PluginInfo-License=GPL
+X-KDE-PluginInfo-EnabledByDefault=true
\ No newline at end of file

-- 
ktp-contact-applet packaging



More information about the pkg-kde-commits mailing list