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


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

The following commit has been merged in the master branch:
commit ca73e9572f8ee19bec57e9456224480cd8cbe16b
Author: Francesco Nwokeka <francesco.nwokeka at gmail.com>
Date:   Wed Dec 7 14:49:55 2011 +0100

    first layout for porting
---
 presence/CMakeLists.txt          | 49 ++++++++++++++++++++-----
 presence/src/presence-applet.cpp | 77 ++++++++++++++++++++++++++++++++++++++++
 presence/src/presence-applet.h   | 56 +++++++++++++++++++++++++++++
 3 files changed, 174 insertions(+), 8 deletions(-)

diff --git a/presence/CMakeLists.txt b/presence/CMakeLists.txt
index 6e18114..1d0a376 100644
--- a/presence/CMakeLists.txt
+++ b/presence/CMakeLists.txt
@@ -1,18 +1,51 @@
-project(plasma-applet-presence)
+project(telepathy-kde-presence-applet)
 
 cmake_minimum_required(VERSION 2.8)
 
-find_package(KDE4 REQUIRED)
+set(CMAKE_MODULE_PATH
+    "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"
+    ${CMAKE_MODULE_PATH}
+)
 
-include(KDE4Defaults)
+set(KDE_MIN_VERSION "4.6.0")
 
-add_definitions(${KDE4_DEFINITIONS})
+set(IS_TELEPATHY_KDE_INTERNAL_MODULE TRUE)
 
-include_directories(
-    ${KDE4_INCLUDES}
+find_package(KDE4 ${KDE_MIN_VERSION} REQUIRED)
+find_package(TelepathyQt4 0.7.1 REQUIRED)
+find_package(KTelepathy REQUIRED)
+
+include(KDE4Defaults)
+
+add_definitions(${QT_DEFINITIONS}
+                ${KDE4_DEFINITIONS}
 )
 
-install(DIRECTORY package/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/org.kde.telepathy-presence PATTERN .git EXCLUDE PATTERN CMakeLists.txt EXCLUDE)
+include_directories(${CMAKE_SOURCE_DIR}
+                    ${CMAKE_BINARY_DIR}
+                    ${KDE4_INCLUDES}
+                    ${TELEPATHY_QT4_INCLUDE_DIR}
+                    ${KTELEPATHY_INCLUDE_DIR}
+)
 
-install(FILES package/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME plasma-applet-telepathy-presence.desktop)
 
+set(telepathy-kde-presence-applet_SRCS
+    src/presenceapplet.cpp
+)
+#
+# kde4_add_ui_files(telepathy-kde-presence-applet_SRCS
+#                     src/config.ui
+# )
+
+kde4_add_plugin(telepathy-kde-presence-applet ${telepathy-kde-presence-applet_SRCS})
+target_link_libraries(telepathy-kde-presence-applet
+                        ${KDE4_PLASMA_LIBS}
+                        ${KDE4_KDEUI_LIBS}
+                        ${TELEPATHY_QT4_LIBRARIES}
+                        ${KTELEPATHY_LIBRARIES}
+                        ${KTELEPATHY_MODELS_LIBRARIES}
+                        ${QT_QTDECLARATIVE_LIBRARY})
+
+install(DIRECTORY src/declarative/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/org.kde.telepathy-kde-presence-applet)
+install(TARGETS telepathy-kde-presence-applet DESTINATION ${PLUGIN_INSTALL_DIR})
+install(FILES telepathy-kde-presence-applet.desktop DESTINATION ${SERVICES_INSTALL_DIR})
diff --git a/presence/src/presence-applet.cpp b/presence/src/presence-applet.cpp
new file mode 100644
index 0000000..61c0865
--- /dev/null
+++ b/presence/src/presence-applet.cpp
@@ -0,0 +1,77 @@
+/***************************************************************************
+ *   Copyright (C) 2011 by Francesco Nwokeka <francesco.nwokeka at gmail.com> *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
+ ***************************************************************************/
+
+#include "presenceapplet.h"
+
+#include <KStandardDirs>
+#include <KTelepathy/global-presence.h>
+#include <KTelepathy/presence.h>
+
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+TelepathyPresenceApplet::TelepathyPresenceApplet(QObject* parent, const QVariantList& args)
+    : Plasma::Applet(parent, args)
+    , m_declarative(new Plasma::DeclarativeWidget(this))
+    , m_qmlObject(0)
+    , m_globalPresence(new KTp::GlobalPresence(this))
+    , m_presenceAppletWrapper(new PresenceAppletWrapper(this))
+{
+    // setup plasmoid size
+    resize(250, 250);
+//     setBackgroundHints(NoBackground);
+
+    setAspectRatioMode(Plasma::FixedSize);
+}
+
+TelepathyPresenceApplet::~TelepathyPresenceApplet()
+{
+    m_declarative->deleteLater();   // do i need to do this?
+//     m_qmlObject ??
+}
+
+void TelepathyPresenceApplet::init()
+{
+    Plasma::Applet::init();
+
+    if (m_declarative) {
+        // sort this path out
+        QString qmlFile = KGlobal::dirs()->findResource("data", "plasma/plasmoids/org.kde.telepathy-contact/contents/ui/main.qml");
+        qDebug() << "LOADING: " << qmlFile;
+        m_declarative->setQmlPath(qmlFile);
+//         m_declarative->engine()->rootContext()->setContextProperty("TelepathyKDEPresenceApplet", /* make presenceWrapper object to interact with QML */);
+
+        // setup qml object so that we can talk to the declarative part
+        m_qmlObject = dynamic_cast<QObject*>(m_declarative->rootObject());
+
+        // connect the qml object to recieve signals from KTP::GlobalPresece
+//         connect(m_contact, SIGNAL(newContactSet()), m_qmlObject, SLOT(updateContact()));
+//         connect(m_contact, SIGNAL(avatarChanged()), m_qmlObject, SLOT(updateContact()));
+//         connect(m_contact, SIGNAL(presenceChanged()), m_qmlObject, SLOT(updateContact()));
+//         connect(m_contact, SIGNAL(accountPresenceChanged()), m_qmlObject, SLOT(accountPresenceChanged()));
+    }
+}
+
+void TelepathyPresenceApplet::paintInterface(QPainter* p, const QStyleOptionGraphicsItem* option, const QRect& contentsRect)
+{
+    Plasma::Applet::paintInterface(p, option, contentsRect);
+}
+
+
+
diff --git a/presence/src/presence-applet.h b/presence/src/presence-applet.h
new file mode 100644
index 0000000..7406104
--- /dev/null
+++ b/presence/src/presence-applet.h
@@ -0,0 +1,56 @@
+/***************************************************************************
+ *   Copyright (C) 2011 by Francesco Nwokeka <francesco.nwokeka at gmail.com> *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
+ ***************************************************************************/
+
+#ifndef TELEPATHY_KDE_PRESENCE_APPLET_H
+#define TELEPATHY_KDE_PRESENCE_APPLET_H
+
+#include <Plasma/Applet>
+#include <Plasma/DeclarativeWidget>
+
+namespace KTp
+{
+    class GlobalPresence;
+}
+
+class PresenceAppletWrapper;
+
+class TelepathyPresenceApplet: public Plasma::Applet
+{
+    Q_OBJECT
+public:
+    TelepathyPresenceApplet(QObject *parent, const QVariantList &args);
+    ~TelepathyPresenceApplet();
+
+    void init();
+    void paintInterface(QPainter *p, const QStyleOptionGraphicsItem *option, const QRect& contentsRect);
+
+//     /** overide of config signal */
+//     void showConfigurationInterface();
+
+private:
+    void saveConfig();
+    void setupAccountManager();
+
+    Plasma::DeclarativeWidget *m_declarative;
+    QObject *m_qmlObject;
+    KTp::GlobalPresence *m_globalPresence;
+    PresenceAppletWrapper *m_presenceAppletWrapper;
+};
+
+#endif  // TELEPATHY_KDE_PRESENCE_APPLET_H

-- 
ktp-contact-applet packaging



More information about the pkg-kde-commits mailing list