[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:20:14 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=3689021

The following commit has been merged in the master branch:
commit 3689021070a55acc601ede775ccdd2ed692765a0
Author: Dominik Schmidt <dev at dominik-schmidt.de>
Date:   Tue Oct 4 23:19:24 2011 +0200

    Make TelepathyLoggerQt4 a soft dep
---
 lib/CMakeLists.txt |  3 +++
 lib/logmanager.cpp | 23 +++++++++++++++++++++--
 lib/logmanager.h   |  9 ++++++++-
 3 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 1db1cc6..9e585bf 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -1,6 +1,9 @@
 macro_optional_find_package(TelepathyLoggerQt4)
 macro_log_feature(TELEPATHY_LOGGER_QT4_FOUND "TelepathyLoggerQt4" "Qt4 wrapper around telepathy-logger" FALSE "" "Needed for optional backlog support in the chat-window")
 macro_display_feature_log()
+if(TELEPATHY_LOGGER_QT4_FOUND)
+    add_definitions( -DTELEPATHY_LOGGER_QT4_FOUND )
+endif()
 
 set(telepathy_chat_handler_lib_SRCS
         chat-widget.cpp
diff --git a/lib/logmanager.cpp b/lib/logmanager.cpp
index 6d62ff3..b3c0b39 100644
--- a/lib/logmanager.cpp
+++ b/lib/logmanager.cpp
@@ -24,6 +24,8 @@
 
 #include <KDebug>
 
+
+#ifdef TELEPATHY_LOGGER_QT4_FOUND
 #include <TelepathyLoggerQt4/Init>
 #include <TelepathyLoggerQt4/Entity>
 #include <TelepathyLoggerQt4/PendingDates>
@@ -35,6 +37,7 @@
 
 #include <glib-object.h>
 #include <QGlib/Init>
+#endif
 
 #include <TelepathyQt4/Types>
 #include <TelepathyQt4/AvatarData>
@@ -46,6 +49,8 @@ LogManager::LogManager(const Tp::AccountPtr &account, const Tp::ContactPtr &cont
     , m_contact(contact)
     , m_fetchAmount(10)
 {
+
+#ifdef TELEPATHY_LOGGER_QT4_FOUND
     g_type_init();
     QGlib::init();
     Tpl::init();
@@ -60,6 +65,9 @@ LogManager::LogManager(const Tp::AccountPtr &account, const Tp::ContactPtr &cont
                                             Tpl::EntityTypeContact,
                                             NULL,
                                             NULL);
+#else
+    kWarning() << "text-ui was built without log support";
+#endif
 }
 
 LogManager::~LogManager()
@@ -69,7 +77,11 @@ LogManager::~LogManager()
 
 bool LogManager::exists() const
 {
+#ifdef TELEPATHY_LOGGER_QT4_FOUND
     return m_logManager->exists(m_account, m_contactEntity, Tpl::EventTypeMaskText);
+#else
+    return false;
+#endif
 }
 
 void LogManager::setTextChannel(const Tp::TextChannelPtr& textChannel)
@@ -84,12 +96,18 @@ void LogManager::setFetchAmount(int n)
 
 void LogManager::fetchLast()
 {
-    kDebug() << "get log for: " << m_contactEntity->identifier();
-
+    kDebug();
+#ifdef TELEPATHY_LOGGER_QT4_FOUND
     Tpl::PendingDates* dates = m_logManager->queryDates( m_account, m_contactEntity, Tpl::EventTypeMaskText);
     connect(dates, SIGNAL(finished(Tpl::PendingOperation*)), SLOT(onDatesFinished(Tpl::PendingOperation*)));
+#else
+    QList<AdiumThemeContentInfo> messages;
+    emit fetched(messages);
+#endif
+
 }
 
+#ifdef TELEPATHY_LOGGER_QT4_FOUND
 void LogManager::onDatesFinished(Tpl::PendingOperation* po)
 {
     Tpl::PendingDates *pd = (Tpl::PendingDates*) po;
@@ -182,3 +200,4 @@ void LogManager::onEventsFinished(Tpl::PendingOperation* po)
     kDebug() << "emit all messages" << messages.count();
     emit fetched(messages);
 }
+#endif
\ No newline at end of file
diff --git a/lib/logmanager.h b/lib/logmanager.h
index e8f3413..2e1e4d6 100644
--- a/lib/logmanager.h
+++ b/lib/logmanager.h
@@ -23,8 +23,10 @@
 
 #include "adium-theme-content-info.h"
 
+#ifdef TELEPATHY_LOGGER_QT4_FOUND
 #include <TelepathyLoggerQt4/LogManager>
 #include <TelepathyLoggerQt4/Entity>
+#endif
 
 #include <TelepathyQt4/Types>
 #include <TelepathyQt4/Account>
@@ -53,16 +55,21 @@ public:
 Q_SIGNALS:
     void fetched(const QList<AdiumThemeContentInfo> &messages);
 
+#ifdef TELEPATHY_LOGGER_QT4_FOUND
 private Q_SLOTS:
     void onDatesFinished(Tpl::PendingOperation* po);
     void onEventsFinished(Tpl::PendingOperation* po);
+#endif
 
 private:
     Tp::AccountPtr m_account;
     Tp::ContactPtr m_contact;
-    Tpl::EntityPtr m_contactEntity;
     Tp::TextChannelPtr m_textChannel;
+#ifdef TELEPATHY_LOGGER_QT4_FOUND
+    Tpl::EntityPtr m_contactEntity;
     Tpl::LogManagerPtr m_logManager;
+#endif
+
 
     int m_fetchAmount;
 };

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list