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


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

The following commit has been merged in the master branch:
commit 152dd26a3bf4e93b075d3da315c5848fec379573
Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Wed Mar 14 23:34:12 2012 +0000

    Split into QML plugin and QML plasmoid
---
 CMakeLists.txt                                     |  34 +-----
 declarative-plugin/CMakeLists.txt                  |  26 ++++
 declarative-plugin/contact-list.cpp                |  78 ++++++++++++
 declarative-plugin/contact-list.h                  |  46 +++++++
 declarative-plugin/qml-plugin.cpp                  |  33 +++++
 declarative-plugin/qml-plugin.h                    |  31 +++++
 declarative-plugin/qmldir                          |   1 +
 .../contents/frames/away.png                       | Bin
 .../contents/frames/busy.png                       | Bin
 .../contents/frames/offline.png                    | Bin
 .../contents/frames/online.png                     | Bin
 .../contents/ui/ContactDisplayName.qml             |   0
 .../contents/ui/ContactList.qml                    |   9 +-
 .../contents/ui/ExternalLabel.qml                  |   0
 .../contents/ui/GridContactDelegate.qml            |   0
 .../contents/ui/ListContactDelegate.qml            |   0
 .../contents/ui/ToolBar.qml                        |   0
 .../contents/ui/main.qml                           |  13 +-
 .../metadata.desktop                               |  15 ++-
 src/telepathyContactList.cpp                       | 133 ---------------------
 src/telepathyContactList.h                         |  62 ----------
 21 files changed, 243 insertions(+), 238 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c2ed221..150d41f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,33 +16,11 @@ find_package(KTp REQUIRED)
 #find_package (KTelepathy REQUIRED)
 
 
-include(KDE4Defaults)
+add_subdirectory(declarative-plugin)
+install(DIRECTORY org.kde.ktp.contactlist
+        DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/)
 
-add_definitions(${QT_DEFINITIONS}
-                ${KDE4_DEFINITIONS}
-)
-
-include_directories(${CMAKE_SOURCE_DIR}
-                    ${CMAKE_BINARY_DIR}
-                    ${KDE4_INCLUDES}
-                    ${TELEPATHY_QT4_INCLUDE_DIR}
-                    ${KTP_INCLUDE_DIR}
-)
-
-set(telepathy_contact_list_applet_SRCS
-    src/telepathyContactList.cpp
-)
-
-kde4_add_plugin(plasma_applet_telepathy_contact_list ${telepathy_contact_list_applet_SRCS})
-
-target_link_libraries(plasma_applet_telepathy_contact_list
-                        ${KDE4_PLASMA_LIBS}
-                        ${KDE4_KDEUI_LIBS}
-                        ${TELEPATHY_QT4_LIBRARIES}
-                        ${QT_QTDECLARATIVE_LIBRARY}
-                        ${KTP_MODELS_LIBRARIES})
-#                        ${KTELEPATHY_MODELS_LIBRARIES})
 
-install(DIRECTORY src/declarative/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/org.kde.telepathy-contact-list)
-install(TARGETS plasma_applet_telepathy_contact_list DESTINATION ${PLUGIN_INSTALL_DIR})
-install(FILES telepathy-contact-list-applet.desktop DESTINATION ${SERVICES_INSTALL_DIR})
+install(FILES org.kde.ktp.contactlist/metadata.desktop
+        DESTINATION ${SERVICES_INSTALL_DIR}
+        RENAME plasma-applet-ktp-contactlist.desktop)
diff --git a/declarative-plugin/CMakeLists.txt b/declarative-plugin/CMakeLists.txt
new file mode 100644
index 0000000..0cebb91
--- /dev/null
+++ b/declarative-plugin/CMakeLists.txt
@@ -0,0 +1,26 @@
+set(ktpcontactlistqmlplugin_SRCS
+        qml-plugin.cpp
+        contact-list.cpp
+    )
+
+include_directories(
+        ${CMAKE_SOURCE_DIR}
+        ${CMAKE_BINARY_DIR}
+        ${KDE4_INCLUDES}
+        ${TELEPATHY_QT4_INCLUDE_DIR}
+)
+
+kde4_add_library(ktpcontactlistqmlplugin SHARED ${ktpcontactlistqmlplugin_SRCS})
+
+target_link_libraries(ktpcontactlistqmlplugin
+        ${KDE4_KDECORE_LIBS}
+        ${QT_QTSCRIPT_LIBRARY}
+        ${QT_QTDECLARATIVE_LIBRARY}
+        ${TELEPATHY_QT4_LIBRARIES}
+        ${KTP_MODELS_LIBRARIES}
+        ${KTP_LIBRARIES}
+        ${KDE4_KDEUI_LIBS}
+)
+
+install(TARGETS ktpcontactlistqmlplugin DESTINATION ${IMPORTS_INSTALL_DIR}/org/kde/telepathy/contactlist)
+install(FILES qmldir DESTINATION ${IMPORTS_INSTALL_DIR}/org/kde/telepathy/contactlist)
diff --git a/declarative-plugin/contact-list.cpp b/declarative-plugin/contact-list.cpp
new file mode 100644
index 0000000..74217bd
--- /dev/null
+++ b/declarative-plugin/contact-list.cpp
@@ -0,0 +1,78 @@
+/*
+    Copyright (C) 2011  David Edmundson <kde at davidedmundson.co.uk>
+
+    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
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+#include "contact-list.h"
+
+#include <TelepathyQt/AccountFactory>
+#include <TelepathyQt/ContactFactory>
+#include <TelepathyQt/ConnectionFactory>
+#include <TelepathyQt/AccountManager>
+#include <TelepathyQt/PendingReady>
+
+ContactList::ContactList(QObject *parent)
+    : QObject(parent),
+      m_accountsModel(new AccountsModel(this)),
+      m_flatModel(new FlatModelProxy(m_accountsModel))
+{
+    Tp::registerTypes();
+
+        // Start setting up the Telepathy AccountManager.
+    Tp::AccountFactoryPtr  accountFactory = Tp::AccountFactory::create(QDBusConnection::sessionBus(),
+                                                                       Tp::Features() << Tp::Account::FeatureCore
+                                                                       << Tp::Account::FeatureAvatar
+                                                                       << Tp::Account::FeatureCapabilities
+                                                                       << Tp::Account::FeatureProtocolInfo
+                                                                       << Tp::Account::FeatureProfile);
+
+    Tp::ConnectionFactoryPtr connectionFactory = Tp::ConnectionFactory::create(QDBusConnection::sessionBus(),
+                                                                               Tp::Features() << Tp::Connection::FeatureCore
+                                                                               << Tp::Connection::FeatureRosterGroups
+                                                                               << Tp::Connection::FeatureRoster
+                                                                               << Tp::Connection::FeatureSelfContact);
+
+    Tp::ContactFactoryPtr contactFactory = Tp::ContactFactory::create(Tp::Features()  << Tp::Contact::FeatureAlias
+                                                                      << Tp::Contact::FeatureAvatarData
+                                                                      << Tp::Contact::FeatureSimplePresence
+                                                                      << Tp::Contact::FeatureCapabilities);
+
+
+
+    Tp::ChannelFactoryPtr channelFactory = Tp::ChannelFactory::create(QDBusConnection::sessionBus());
+
+     m_accountManager = Tp::AccountManager::create(QDBusConnection::sessionBus(),
+                                                   accountFactory,
+                                                   connectionFactory,
+                                                   channelFactory,
+                                                   contactFactory);
+
+    connect(m_accountManager->becomeReady(),
+            SIGNAL(finished(Tp::PendingOperation*)),
+            SLOT(onAccountManagerReady(Tp::PendingOperation*)));
+}
+
+
+void ContactList::onAccountManagerReady(Tp::PendingOperation *op)
+{
+    Q_UNUSED(op);
+    m_accountsModel->setAccountManager(m_accountManager);
+}
+
+FlatModelProxy * ContactList::flatModel() const
+{
+    return m_flatModel;
+}
diff --git a/declarative-plugin/contact-list.h b/declarative-plugin/contact-list.h
new file mode 100644
index 0000000..dd7f3eb
--- /dev/null
+++ b/declarative-plugin/contact-list.h
@@ -0,0 +1,46 @@
+/*
+    Copyright (C) 2011  David Edmundson <kde at davidedmundson.co.uk>
+
+    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
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+#ifndef CONTACT_LIST_H
+#define CONTACT_LIST_H
+
+#include <KTp/Models/accounts-model.h>
+#include <KTp/Models/flat-model-proxy.h>
+
+#include <TelepathyQt/Types>
+
+/** Exposes general contact list stuff to QML*/
+class ContactList : public QObject
+{   
+    Q_OBJECT
+public:
+    Q_PROPERTY(QObject* model READ flatModel)
+    
+    ContactList(QObject *parent=0);
+    FlatModelProxy* flatModel() const;
+    
+private slots:
+    void onAccountManagerReady(Tp::PendingOperation *op);
+    
+private:
+    AccountsModel* m_accountsModel;
+    FlatModelProxy* m_flatModel; 
+    Tp::AccountManagerPtr m_accountManager;
+};
+
+#endif
diff --git a/declarative-plugin/qml-plugin.cpp b/declarative-plugin/qml-plugin.cpp
new file mode 100644
index 0000000..b06778e
--- /dev/null
+++ b/declarative-plugin/qml-plugin.cpp
@@ -0,0 +1,33 @@
+/*
+    Copyright (C) 2011  Lasath Fernando <kde at lasath.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
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+
+#include "qml-plugin.h"
+
+#include <QtDeclarative/QDeclarativeItem>
+
+#include "contact-list.h"
+
+void QmlPlugin::registerTypes(const char *uri)
+{
+    // this can be used in QML because it spits out Conversations which
+    // can be given to ChatWidget.qml
+    qmlRegisterType<ContactList> (uri, 0, 1, "ContactList");
+}
+
+Q_EXPORT_PLUGIN2(contactlist, QmlPlugin);
diff --git a/declarative-plugin/qml-plugin.h b/declarative-plugin/qml-plugin.h
new file mode 100644
index 0000000..ad56781
--- /dev/null
+++ b/declarative-plugin/qml-plugin.h
@@ -0,0 +1,31 @@
+/*
+    Copyright (C) 2011  Lasath Fernando <kde at lasath.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
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+
+#ifndef QML_PLUGIN_H
+#define QML_PLUGIN_H
+
+#include <QtDeclarative/QDeclarativeExtensionPlugin>
+
+class QmlPlugin : public QDeclarativeExtensionPlugin
+{
+public:
+    virtual void registerTypes(const char *uri);
+};
+
+#endif // QML_PLUGINS_H
diff --git a/declarative-plugin/qmldir b/declarative-plugin/qmldir
new file mode 100644
index 0000000..b1178c8
--- /dev/null
+++ b/declarative-plugin/qmldir
@@ -0,0 +1 @@
+plugin ktpcontactlistqmlplugin
\ No newline at end of file
diff --git a/src/declarative/contents/frames/away.png b/org.kde.ktp.contactlist/contents/frames/away.png
similarity index 100%
rename from src/declarative/contents/frames/away.png
rename to org.kde.ktp.contactlist/contents/frames/away.png
diff --git a/src/declarative/contents/frames/busy.png b/org.kde.ktp.contactlist/contents/frames/busy.png
similarity index 100%
rename from src/declarative/contents/frames/busy.png
rename to org.kde.ktp.contactlist/contents/frames/busy.png
diff --git a/src/declarative/contents/frames/offline.png b/org.kde.ktp.contactlist/contents/frames/offline.png
similarity index 100%
rename from src/declarative/contents/frames/offline.png
rename to org.kde.ktp.contactlist/contents/frames/offline.png
diff --git a/src/declarative/contents/frames/online.png b/org.kde.ktp.contactlist/contents/frames/online.png
similarity index 100%
rename from src/declarative/contents/frames/online.png
rename to org.kde.ktp.contactlist/contents/frames/online.png
diff --git a/src/declarative/contents/ui/ContactDisplayName.qml b/org.kde.ktp.contactlist/contents/ui/ContactDisplayName.qml
similarity index 100%
rename from src/declarative/contents/ui/ContactDisplayName.qml
rename to org.kde.ktp.contactlist/contents/ui/ContactDisplayName.qml
diff --git a/src/declarative/contents/ui/ContactList.qml b/org.kde.ktp.contactlist/contents/ui/ContactList.qml
similarity index 97%
rename from src/declarative/contents/ui/ContactList.qml
rename to org.kde.ktp.contactlist/contents/ui/ContactList.qml
index d4c7d39..5228e88 100644
--- a/src/declarative/contents/ui/ContactList.qml
+++ b/org.kde.ktp.contactlist/contents/ui/ContactList.qml
@@ -19,6 +19,8 @@
 
 import Qt 4.7
 import org.kde.plasma.graphicswidgets 0.1 as PlasmaWidgets
+import org.kde.telepathy.contactlist 0.1 as KtpContactList
+
 
 
 /// TODO
@@ -35,6 +37,11 @@ Item {
     id: contactListContainer;
     anchors.fill: parent;    
     
+    KtpContactList.ContactList {
+        id: contactList
+    }
+    
+    
     // TOOLBAR
     ToolBar {
         id: toolbar;
@@ -71,7 +78,7 @@ Item {
         }
 
         clip: true;
-        model: contactListModel;
+        model: contactList.model;
         boundsBehavior: Flickable.StopAtBounds
 
         delegate:
diff --git a/src/declarative/contents/ui/ExternalLabel.qml b/org.kde.ktp.contactlist/contents/ui/ExternalLabel.qml
similarity index 100%
rename from src/declarative/contents/ui/ExternalLabel.qml
rename to org.kde.ktp.contactlist/contents/ui/ExternalLabel.qml
diff --git a/src/declarative/contents/ui/GridContactDelegate.qml b/org.kde.ktp.contactlist/contents/ui/GridContactDelegate.qml
similarity index 100%
rename from src/declarative/contents/ui/GridContactDelegate.qml
rename to org.kde.ktp.contactlist/contents/ui/GridContactDelegate.qml
diff --git a/src/declarative/contents/ui/ListContactDelegate.qml b/org.kde.ktp.contactlist/contents/ui/ListContactDelegate.qml
similarity index 100%
rename from src/declarative/contents/ui/ListContactDelegate.qml
rename to org.kde.ktp.contactlist/contents/ui/ListContactDelegate.qml
diff --git a/src/declarative/contents/ui/ToolBar.qml b/org.kde.ktp.contactlist/contents/ui/ToolBar.qml
similarity index 100%
rename from src/declarative/contents/ui/ToolBar.qml
rename to org.kde.ktp.contactlist/contents/ui/ToolBar.qml
diff --git a/src/declarative/contents/ui/main.qml b/org.kde.ktp.contactlist/contents/ui/main.qml
similarity index 90%
rename from src/declarative/contents/ui/main.qml
rename to org.kde.ktp.contactlist/contents/ui/main.qml
index 9bb1ec8..3391c9a 100644
--- a/src/declarative/contents/ui/main.qml
+++ b/org.kde.ktp.contactlist/contents/ui/main.qml
@@ -22,9 +22,9 @@ import Qt 4.7
 Item {
     id: main;
 
-    anchors.fill: parent
-    // plasmoid starting size
-
+    width: 200
+    height: 300
+    
     // contact listview
     ContactList {
         id: contactList;
@@ -36,11 +36,4 @@ Item {
         
         state: "listView";   // start with list view
     }
-
-//     Rectangle {
-//         anchors.fill: parent;
-//         color: "transparent";
-//         border.color: "green"
-//     }
-
 }
diff --git a/telepathy-contact-list-applet.desktop b/org.kde.ktp.contactlist/metadata.desktop
similarity index 60%
rename from telepathy-contact-list-applet.desktop
rename to org.kde.ktp.contactlist/metadata.desktop
index 150d505..01819ef 100644
--- a/telepathy-contact-list-applet.desktop
+++ b/org.kde.ktp.contactlist/metadata.desktop
@@ -7,13 +7,20 @@ Icon=meeting-attending
 
 X-Plasma-DefaultSize=250,300
 
-X-KDE-Library=plasma_applet_telepathy_contact_list
+
+X-Plasma-API=declarativeappletscript
+X-Plasma-MainScript=ui/main.qml
+X-Plasma-DefaultSize=200,100
+
 X-KDE-PluginInfo-Name=telepathy_contact_list
 X-KDE-PluginInfo-Category=Online Services
-X-KDE-PluginInfo-Author=Francesco Nwokeka
-X-KDE-PluginInfo-Email=francesco.nwokeka at gmail.com
+X-KDE-PluginInfo-Author=David Edmundson
+X-KDE-PluginInfo-Email=kde at davidedmundson.co.uk
 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
+X-KDE-PluginInfo-EnabledByDefault=true
+X-KDE-ServiceTypes=Plasma/Applet
+Type=Service
\ No newline at end of file
diff --git a/src/telepathyContactList.cpp b/src/telepathyContactList.cpp
deleted file mode 100644
index cf68d2e..0000000
--- a/src/telepathyContactList.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-/***************************************************************************
- *   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 "telepathyContactList.h"
-
-#include <KStandardDirs>
-
-#include <QtDeclarative/QDeclarativeEngine>
-#include <QtDeclarative/QDeclarativeContext>
-
-#include <TelepathyQt/AccountFactory>
-#include <TelepathyQt/ContactFactory>
-#include <TelepathyQt/ConnectionFactory>
-#include <TelepathyQt/AccountManager>
-#include <TelepathyQt/PendingReady>
-
-#include <KTp/Models/accounts-model.h>
-#include <KTp/Models/flat-model-proxy.h>
-
-
-
-TelepathyContactList::TelepathyContactList(QObject* parent, const QVariantList& args)
-    : Applet(parent, args)
-    , m_declarative(new Plasma::DeclarativeWidget(this))
-    , m_qmlObject(0)
-{
-    // set plasmoid size
-    setMinimumSize(250, 400);
-    setAspectRatioMode(Plasma::IgnoreAspectRatio);
-
-    Tp::registerTypes();
-
-        // Start setting up the Telepathy AccountManager.
-    Tp::AccountFactoryPtr  accountFactory = Tp::AccountFactory::create(QDBusConnection::sessionBus(),
-                                                                       Tp::Features() << Tp::Account::FeatureCore
-                                                                       << Tp::Account::FeatureAvatar
-                                                                       << Tp::Account::FeatureCapabilities
-                                                                       << Tp::Account::FeatureProtocolInfo
-                                                                       << Tp::Account::FeatureProfile);
-
-    Tp::ConnectionFactoryPtr connectionFactory = Tp::ConnectionFactory::create(QDBusConnection::sessionBus(),
-                                                                               Tp::Features() << Tp::Connection::FeatureCore
-                                                                               << Tp::Connection::FeatureRosterGroups
-                                                                               << Tp::Connection::FeatureRoster
-                                                                               << Tp::Connection::FeatureSelfContact);
-
-    Tp::ContactFactoryPtr contactFactory = Tp::ContactFactory::create(Tp::Features()  << Tp::Contact::FeatureAlias
-                                                                      << Tp::Contact::FeatureAvatarData
-                                                                      << Tp::Contact::FeatureSimplePresence
-                                                                      << Tp::Contact::FeatureCapabilities);
-
-
-
-    Tp::ChannelFactoryPtr channelFactory = Tp::ChannelFactory::create(QDBusConnection::sessionBus());
-
-     m_accountManager = Tp::AccountManager::create(QDBusConnection::sessionBus(),
-                                                   accountFactory,
-                                                   connectionFactory,
-                                                   channelFactory,
-                                                   contactFactory);
-
-    connect(m_accountManager->becomeReady(),
-            SIGNAL(finished(Tp::PendingOperation*)),
-            SLOT(onAccountManagerReady(Tp::PendingOperation*)));
-    
-    m_model = new AccountsModel(this);
-    m_proxyModel = new FlatModelProxy(m_model);
-}
-
-TelepathyContactList::~TelepathyContactList()
-{
-    delete m_declarative;
-}
-
-int TelepathyContactList::appletHeight() const
-{
-    return geometry().height();
-}
-
-int TelepathyContactList::appletWidth() const
-{
-    return geometry().width();
-}
-
-
-void TelepathyContactList::init()
-{
-    // load QML part of the plasmoid
-    if (m_declarative) {
-        QString qmlFile = KGlobal::dirs()->findResource("data", "plasma/plasmoids/org.kde.telepathy-contact-list/contents/ui/main.qml");
-        qDebug() << "LOADING: " << qmlFile;
-        m_declarative->setQmlPath(qmlFile);
-
-        // make C++ Plasma::Applet available to QML for resize signal
-        m_declarative->engine()->rootContext()->setContextProperty("TelepathyContactList", this);
-        m_declarative->engine()->rootContext()->setContextProperty("contactListModel", m_proxyModel);
-
-        // 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 C++ end
-        // these two signals are for the plasmoid resize. QML can't determine the Plasma::DeclarativeWidget's boundaries
-        connect(this, SIGNAL(widthChanged()), m_qmlObject, SLOT(onWidthChanged()));
-        connect(this, SIGNAL(heightChanged()), m_qmlObject, SLOT(onHeightChanged()));
-
-        //FIXME this code is messy, steal from qmlsplashscreen
-    }
-}
-
-
-// This is the command that links your applet to the .desktop file
-K_EXPORT_PLASMA_APPLET(telepathy-contact-list, TelepathyContactList)
-
-void TelepathyContactList::onAccountManagerReady(Tp::PendingOperation *op)
-{
-    m_model->setAccountManager(m_accountManager);
-}
diff --git a/src/telepathyContactList.h b/src/telepathyContactList.h
deleted file mode 100644
index f2ae467..0000000
--- a/src/telepathyContactList.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/***************************************************************************
- *   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_CONTACT_LIST_H
-#define TELEPATHY_CONTACT_LIST_H
-
-#include <Plasma/Applet>
-#include <Plasma/DeclarativeWidget>
-
-#include <TelepathyQt/Types>
-
-class AccountsModel;
-class FlatModelProxy;
-
-namespace Tp {
-class PendingOperation;
-}
-
-class TelepathyContactList : public Plasma::Applet
-{
-    Q_OBJECT
-public:
-    TelepathyContactList(QObject *parent, const QVariantList &args);
-    virtual ~TelepathyContactList();
-
-    Q_PROPERTY(int width READ appletWidth);
-    Q_PROPERTY(int height READ appletHeight);
-
-    int appletHeight() const;     /** returns plasma applet's height */
-    int appletWidth() const;      /** returns plasma applet's width */
-    void init();
-
-private slots:
-    void onAccountManagerReady(Tp::PendingOperation *op);
-//     QString extractAvatarPathFromNepomuk(const QString &nepomukUri);
-
-private:
-    Plasma::DeclarativeWidget *m_declarative;
-    QObject *m_qmlObject;
-    Tp::AccountManagerPtr m_accountManager;
-    
-    AccountsModel *m_model;
-    FlatModelProxy *m_proxyModel;
-};
-
-#endif  // TELEPATHY_CONTACT_LIST_H

-- 
ktp-contact-applet packaging



More information about the pkg-kde-commits mailing list