[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9

Maximiliano Curia maxy at moszumanska.debian.org
Mon May 9 09:07:12 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=b1e333c

The following commit has been merged in the master branch:
commit b1e333c8bb59a701db6968cc8680d00386328f78
Author: Daniele Elmo Domenichelli <daniele.domenichelli at gmail.com>
Date:   Thu Sep 30 12:50:17 2010 +0000

    Make telepathy-integration-daemon a Nepomuk Service
    
    Having a Nepomuk service instead of a daemon allows to check for services
    dependencies just by adding 1 line in the .desktop file and the service will be
    started as soon as the dependencies are ready.
    
    It also adds automatically a dbus interface that allows to check if the service
    is available or running, and to start and stop the service.
    
    See also http://reviewboard.kde.org/r/5449
    Closes bug #246247
    
    
    svn path=/trunk/playground/network/telepathy-integration-daemon/; revision=1181210
---
 kpeople/nepomuk-feeder/CMakeLists.txt              | 40 ++++++----
 kpeople/nepomuk-feeder/main.cpp                    | 87 ----------------------
 .../account-test.h => nepomuktelepathyservice.cpp} | 46 +++++-------
 .../nepomuk-feeder/nepomuktelepathyservice.desktop |  9 +++
 .../account-test.h => nepomuktelepathyservice.h}   | 41 ++++------
 kpeople/nepomuk-feeder/tests/CMakeLists.txt        |  2 +-
 6 files changed, 70 insertions(+), 155 deletions(-)

diff --git a/kpeople/nepomuk-feeder/CMakeLists.txt b/kpeople/nepomuk-feeder/CMakeLists.txt
index ec763ec..c93c830 100644
--- a/kpeople/nepomuk-feeder/CMakeLists.txt
+++ b/kpeople/nepomuk-feeder/CMakeLists.txt
@@ -64,10 +64,12 @@ target_link_libraries (nie
                        ${NEPOMUK_LIBRARIES}
 )
 
+set_property(TARGET nie PROPERTY COMPILE_FLAGS -fPIC)
+
 ####################################
-# Second target - integration daemon static library
+# Second target - nepomuktelepathyservice static library
 
-set (telepathy_integration_daemon_static_SRCS
+set (nepomuktelepathyservice_static_SRCS
      telepathyaccountmonitor.cpp
      telepathyaccount.cpp
      telepathycontact.cpp
@@ -95,41 +97,51 @@ soprano_add_ontology (telepathy_SRCS
                       "trig"
 )
 
-kde4_add_library (telepathy-integration-daemon-static
+kde4_add_library (nepomuktelepathyservice-static
                   STATIC
-                  ${telepathy_integration_daemon_static_SRCS}
+                  ${nepomuktelepathyservice_static_SRCS}
                   ${pimo_SRCS}
                   ${nco_SRCS}
                   ${telepathy_SRCS}
 )
 
-target_link_libraries (telepathy-integration-daemon-static
+target_link_libraries (nepomuktelepathyservice-static
                        ${QT_QTCORE_LIBRARY}
                        ${QT_QTDBUS_LIBRARY}
                        ${KDE4_KDECORE_LIBS}
                        ${TELEPATHY_QT4_LIBRARIES}
+                       ${SOPRANO_LIBRARIES}
                        ${NEPOMUK_LIBRARIES}
                        ${NEPOMUK_QUERY_LIBRARIES}
                        nie
 )
 
+set_property(TARGET nepomuktelepathyservice-static PROPERTY COMPILE_FLAGS -fPIC)
+
 ####################################
-# Third target - integration daemon
+# Third target - nepomuktelepatyservice
 
-# Build the daemon.
-kde4_add_executable (telepathy-integration-daemon
-                     main.cpp
+set (nepomuktelepathyservice_SRCS
+     nepomuktelepathyservice.cpp
 )
 
-target_link_libraries (telepathy-integration-daemon
-                       telepathy-integration-daemon-static
+# Build the service.
+kde4_add_plugin(nepomuktelepathyservice
+                ${nepomuktelepathyservice_SRCS}
 )
 
-# Install the daemon.
-install (TARGETS telepathy-integration-daemon
-         ${INSTALL_TARGETS_DEFAULT_ARGS}
+target_link_libraries (nepomuktelepathyservice
+                       nepomuktelepathyservice-static
 )
 
+# Install the service.
+install (TARGETS nepomuktelepathyservice
+         DESTINATION ${PLUGIN_INSTALL_DIR}
+)
+
+install (FILES nepomuktelepathyservice.desktop
+         DESTINATION ${SERVICES_INSTALL_DIR}
+)
 
 # Install the ontology
 macro(INSTALL_ONTOLOGY _name _group)
diff --git a/kpeople/nepomuk-feeder/main.cpp b/kpeople/nepomuk-feeder/main.cpp
deleted file mode 100644
index 83a18ce..0000000
--- a/kpeople/nepomuk-feeder/main.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * This file is part of telepathy-integration-daemon
- *
- * Copyright (C) 2009-2010 Collabora Ltd. <info at collabora.co.uk>
- *   @author George Goldberg <george.goldberg at collabora.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 St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-extern "C"
-{
-#include <signal.h>
-}
-
-#include "telepathyaccountmonitor.h"
-
-#include <KAboutData>
-#include <KCmdLineArgs>
-#include <KDebug>
-#include <KUniqueApplication>
-
-#include <Nepomuk/ResourceManager>
-
-#include <TelepathyQt4/Types>
-
-namespace
-{
-    static void signal_handler(int signal)
-    {
-        if ((signal == SIGTERM) || (signal == SIGINT)) {
-            QCoreApplication * const app(QCoreApplication::instance());
-            if (app != 0) {
-                app->quit();
-            }
-        }
-    }
-}
-
-int main(int argc, char *argv[])
-{
-    KAboutData aboutData("telepathy-integration-daemon",
-                         0,
-                         ki18n("Telepathy Integration Daemon"),
-                         "0.1");
-
-    KCmdLineArgs::init(argc, argv, &aboutData);
-    KUniqueApplication app;
-
-    // Initialise Nepomuk.
-    Nepomuk::ResourceManager::instance()->init();
-
-    // Initialise Telepathy.
-    Tp::registerTypes();
-
-    // Create an instance of the Telepathy Account Monitor.
-    TelepathyAccountMonitor *monitor = new TelepathyAccountMonitor(&app);
-
-    // Set up signal handlers.
-    if (signal(SIGINT, signal_handler) == SIG_ERR) {
-        kWarning() << "Setting up SIGINT signal handler failed.";
-    }
-
-    if (signal(SIGTERM, signal_handler) == SIG_ERR) {
-        kWarning() << "Setting up SIGTERM signal handler failed.";
-    }
-
-    // Quie the application when the monitor is destroyed.
-    QObject::connect(monitor, SIGNAL(destroyed()), &app, SLOT(quit()));
-
-    kDebug() << "Let's go...";
-
-    // Start event loop.
-    return app.exec();
-}
-
diff --git a/kpeople/nepomuk-feeder/tests/account-test.h b/kpeople/nepomuk-feeder/nepomuktelepathyservice.cpp
similarity index 54%
copy from kpeople/nepomuk-feeder/tests/account-test.h
copy to kpeople/nepomuk-feeder/nepomuktelepathyservice.cpp
index 5df8c47..7057340 100644
--- a/kpeople/nepomuk-feeder/tests/account-test.h
+++ b/kpeople/nepomuk-feeder/nepomuktelepathyservice.cpp
@@ -2,7 +2,8 @@
  * This file is part of telepathy-integration-daemon
  *
  * Copyright (C) 2009-2010 Collabora Ltd. <info at collabora.co.uk>
- *   @author Dario Freddi <dario.freddi at collabora.co.uk>
+ *   @author George Goldberg <george.goldberg at collabora.co.uk>
+ * Copyright (C) 2010 Daniele E. Domenichelli <daniele.domenichelli 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
@@ -19,37 +20,30 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef ACCOUNT_TEST_H
-#define ACCOUNT_TEST_H
-
-#include "tid-base-test.h"
+#include "nepomuktelepathyservice.h"
 
+#include "telepathyaccountmonitor.h"
+#include <Nepomuk/ResourceManager>
 #include <TelepathyQt4/Types>
+#include <KPluginFactory>
 
-#include <Nepomuk/Resource>
-
-class TelepathyAccountMonitor;
-namespace Soprano {
-class StorageModel;
-}
+using namespace Nepomuk;
 
-class KTempDir;
-class AccountTest : public TidBaseTest
+TelepathyService::TelepathyService(QObject* parent, const QVariantList &)
+    : Nepomuk::Service(parent, true)
 {
-    Q_OBJECT
-public:
-    AccountTest(QObject* parent = 0);
-    virtual ~AccountTest();
+    // Initialise Telepathy.
+    Tp::registerTypes();
 
-private Q_SLOTS:
-    void initTestCase();
+    // Create an instance of the Telepathy Account Monitor.
+    TelepathyAccountMonitor *monitor = new TelepathyAccountMonitor(this);
 
-    void testSetupAccountMonitor();
-    void testAccountCreation();
-    void testChangeNickname();
-    void testChangeAvatar();
+    setServiceInitialized(true);
+}
+
+TelepathyService::~TelepathyService()
+{
+}
 
-    void cleanupTestCase();
-};
 
-#endif // ACCOUNT_TEST_H
+NEPOMUK_EXPORT_SERVICE( TelepathyService, "nepomuktelepathyservice" );
diff --git a/kpeople/nepomuk-feeder/nepomuktelepathyservice.desktop b/kpeople/nepomuk-feeder/nepomuktelepathyservice.desktop
new file mode 100644
index 0000000..fcb8b99
--- /dev/null
+++ b/kpeople/nepomuk-feeder/nepomuktelepathyservice.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Type=Service
+ServiceTypes=NepomukService
+X-KDE-Library=nepomuktelepathyservice
+X-KDE-Nepomuk-autostart=true
+X-KDE-Nepomuk-start-on-demand=false
+X-KDE-Nepomuk-dependencies=nepomukstorage,nepomukqueryservice
+Name=Nepomuk Telepathy Service
+Comment=A Nepomuk service that imports Telepathy data
diff --git a/kpeople/nepomuk-feeder/tests/account-test.h b/kpeople/nepomuk-feeder/nepomuktelepathyservice.h
similarity index 55%
copy from kpeople/nepomuk-feeder/tests/account-test.h
copy to kpeople/nepomuk-feeder/nepomuktelepathyservice.h
index 5df8c47..a5ee83f 100644
--- a/kpeople/nepomuk-feeder/tests/account-test.h
+++ b/kpeople/nepomuk-feeder/nepomuktelepathyservice.h
@@ -1,8 +1,7 @@
 /*
  * This file is part of telepathy-integration-daemon
  *
- * Copyright (C) 2009-2010 Collabora Ltd. <info at collabora.co.uk>
- *   @author Dario Freddi <dario.freddi at collabora.co.uk>
+ * Copyright (C) 2010 Daniele E. Domenichelli <daniele.domenichelli 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
@@ -19,37 +18,25 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef ACCOUNT_TEST_H
-#define ACCOUNT_TEST_H
+#ifndef NEPOMUKTELEPATHYSERVICE_H
+#define NEPOMUKTELEPATHYSERVICE_H
 
-#include "tid-base-test.h"
+#include <Nepomuk/Service>
+#include <QtCore/QVariantList>
 
-#include <TelepathyQt4/Types>
 
-#include <Nepomuk/Resource>
-
-class TelepathyAccountMonitor;
-namespace Soprano {
-class StorageModel;
-}
+namespace Nepomuk
+{
 
-class KTempDir;
-class AccountTest : public TidBaseTest
+class TelepathyService : public Nepomuk::Service
 {
     Q_OBJECT
-public:
-    AccountTest(QObject* parent = 0);
-    virtual ~AccountTest();
-
-private Q_SLOTS:
-    void initTestCase();
 
-    void testSetupAccountMonitor();
-    void testAccountCreation();
-    void testChangeNickname();
-    void testChangeAvatar();
-
-    void cleanupTestCase();
+public:
+    TelepathyService(QObject* parent, const QVariantList&);
+    ~TelepathyService();
 };
 
-#endif // ACCOUNT_TEST_H
+} // namespace Nepomuk
+
+#endif // NEPOMUKTELEPATHYSERVICE_H
diff --git a/kpeople/nepomuk-feeder/tests/CMakeLists.txt b/kpeople/nepomuk-feeder/tests/CMakeLists.txt
index 8320bf1..1a64348 100644
--- a/kpeople/nepomuk-feeder/tests/CMakeLists.txt
+++ b/kpeople/nepomuk-feeder/tests/CMakeLists.txt
@@ -10,7 +10,7 @@ kde4_add_library(tid-base-tests STATIC tid-base-test.cpp)
 target_link_libraries(tid-base-tests
                       ${KTELEPATHYTESTLIB_LIBRARIES}
                       ${QT_QTTEST_LIBRARY}
-                      telepathy-integration-daemon-static)
+                      nepomuktelepathyservice-static)
 
 ################################
 # Account test

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list