[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:08:35 UTC 2016


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

The following commit has been merged in the master branch:
commit 51af0ee921337ea3b5946caa2700d6a6ac2c5ad7
Author: Aleix Pol <aleixpol at kde.org>
Date:   Mon Dec 15 14:43:55 2014 +0100

    Remove KDELibs4Support from KTp::Declarative
    
    It was only being used by KDebug and some headers.
---
 KTp/Declarative/CMakeLists.txt            |  4 +++-
 KTp/Declarative/conversation.cpp          | 13 +++++------
 KTp/Declarative/conversations-model.cpp   |  8 +++----
 KTp/{Models => Declarative}/debug.cpp     |  2 +-
 KTp/{OTR => Declarative}/debug.h          |  6 ++---
 KTp/Declarative/messages-model.cpp        | 38 +++++++++++++++----------------
 KTp/Declarative/pinned-contacts-model.cpp |  3 +--
 KTp/Declarative/telepathy-manager.cpp     |  1 -
 8 files changed, 37 insertions(+), 38 deletions(-)

diff --git a/KTp/Declarative/CMakeLists.txt b/KTp/Declarative/CMakeLists.txt
index 97d66f0..1dbafea 100644
--- a/KTp/Declarative/CMakeLists.txt
+++ b/KTp/Declarative/CMakeLists.txt
@@ -13,6 +13,7 @@ set (ktp_qml_plugin_SRCS
     contact-pin.cpp
     telepathy-manager.cpp
     qml-plugins.cpp
+    debug.cpp
 )
 
 add_library (ktpqmlplugin SHARED ${ktp_qml_plugin_SRCS})
@@ -20,7 +21,8 @@ add_library (ktpqmlplugin SHARED ${ktp_qml_plugin_SRCS})
 target_link_libraries (ktpqmlplugin
     Qt5::Qml
     
-    KF5::KDELibs4Support
+    KF5::WindowSystem
+    KF5::I18n
     KTp::CommonInternals
     KTp::Logger
     KTp::Models
diff --git a/KTp/Declarative/conversation.cpp b/KTp/Declarative/conversation.cpp
index e575dcb..325b542 100644
--- a/KTp/Declarative/conversation.cpp
+++ b/KTp/Declarative/conversation.cpp
@@ -25,7 +25,7 @@
 #include <TelepathyQt/PendingChannelRequest>
 #include <TelepathyQt/PendingChannel>
 
-#include <KDebug>
+#include "debug.h"
 
 #include "channel-delegator.h"
 
@@ -50,7 +50,7 @@ Conversation::Conversation(const Tp::TextChannelPtr &channel,
         QObject(parent),
         d (new ConversationPrivate)
 {
-    kDebug();
+    qCDebug(KTP_DECLARATIVE);
 
     d->account = account;
     connect(d->account.data(), SIGNAL(connectionChanged(Tp::ConnectionPtr)), SLOT(onAccountConnectionChanged(Tp::ConnectionPtr)));
@@ -78,8 +78,7 @@ Conversation::Conversation(const Tp::TextChannelPtr &channel,
 
 Conversation::Conversation(QObject *parent) : QObject(parent)
 {
-    kError() << "Conversation should not be created directly. Use ConversationWatcher instead.";
-    Q_ASSERT(false);
+    qCCritical(KTP_DECLARATIVE) << "Conversation should not be created directly. Use ConversationWatcher instead.";
 }
 
 void Conversation::setTextChannel(const Tp::TextChannelPtr& channel)
@@ -156,7 +155,7 @@ bool Conversation::isValid()
 
 void Conversation::onChannelInvalidated(Tp::DBusProxy *proxy, const QString &errorName, const QString &errorMessage)
 {
-    kDebug() << proxy << errorName << ":" << errorMessage;
+    qCDebug(KTP_DECLARATIVE) << proxy << errorName << ":" << errorMessage;
 
     d->valid = false;
 
@@ -198,7 +197,7 @@ void Conversation::delegateToProperClient()
 
 void Conversation::requestClose()
 {
-    kDebug();
+    qCDebug(KTP_DECLARATIVE);
 
     //removing from the model will delete this object closing the channel
     Q_EMIT conversationCloseRequested();
@@ -230,7 +229,7 @@ void Conversation::onChatPausedTimerExpired()
 
 Conversation::~Conversation()
 {
-    kDebug();
+    qCDebug(KTP_DECLARATIVE);
     //if we are not handling the channel do nothing.
     if (!d->delegated) {
         d->messages->textChannel()->requestClose();
diff --git a/KTp/Declarative/conversations-model.cpp b/KTp/Declarative/conversations-model.cpp
index fa9f237..b824878 100644
--- a/KTp/Declarative/conversations-model.cpp
+++ b/KTp/Declarative/conversations-model.cpp
@@ -21,7 +21,7 @@
 #include "conversation.h"
 #include "messages-model.h"
 
-#include <KDebug>
+#include "debug.h"
 
 #include <TelepathyQt/ChannelClassSpec>
 #include <TelepathyQt/TextChannel>
@@ -64,7 +64,7 @@ QVariant ConversationsModel::data(const QModelIndex &index, int role) const
     if (index.isValid()) {
         if (role == ConversationRole) {
             result = QVariant::fromValue<Conversation*>(d->conversations[index.row()]);
-            kDebug() << "returning value " << result;
+            qCDebug(KTP_DECLARATIVE) << "returning value " << result;
         }
     }
     return result;
@@ -104,7 +104,7 @@ void ConversationsModel::handleChannels(const Tp::MethodInvocationContextPtr<> &
 
     //find the relevant channelRequest
     Q_FOREACH(const Tp::ChannelRequestPtr channelRequest, channelRequests) {
-        kDebug() << channelRequest->hints().allHints();
+        qCDebug(KTP_DECLARATIVE) << channelRequest->hints().allHints();
         shouldDelegate = channelRequest->hints().hint(QLatin1String("org.freedesktop.Telepathy.ChannelRequest"), QLatin1String("DelegateToPreferredHandler")).toBool();
     }
 
@@ -172,7 +172,7 @@ void ConversationsModel::removeConversation(Conversation* conv)
         conv->deleteLater();
         endRemoveRows();
     } else {
-        kError() << "attempting to delete non-existent conversation";
+        qWarning() << "attempting to delete non-existent conversation";
     }
 }
 
diff --git a/KTp/Models/debug.cpp b/KTp/Declarative/debug.cpp
similarity index 93%
copy from KTp/Models/debug.cpp
copy to KTp/Declarative/debug.cpp
index 273c714..724e3f3 100644
--- a/KTp/Models/debug.cpp
+++ b/KTp/Declarative/debug.cpp
@@ -17,4 +17,4 @@
  */
 
 #include "debug.h"
-Q_LOGGING_CATEGORY(KTP_MODELS, "ktp-models")
+Q_LOGGING_CATEGORY(KTP_DECLARATIVE, "ktp-declarative")
diff --git a/KTp/OTR/debug.h b/KTp/Declarative/debug.h
similarity index 90%
copy from KTp/OTR/debug.h
copy to KTp/Declarative/debug.h
index 379cc84..f5dc09b 100644
--- a/KTp/OTR/debug.h
+++ b/KTp/Declarative/debug.h
@@ -17,13 +17,13 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef KTP_OTR_DEBUG_H
-#define KTP_OTR_DEBUG_H
+#ifndef KTP_DECLARATIVE_DEBUG_H
+#define KTP_DECLARATIVE_DEBUG_H
 
 #include <QLoggingCategory>
 // include the QDebug here so there doesn't have to
 // be two debug includes in the files using qCDebug
 #include <QDebug>
-Q_DECLARE_LOGGING_CATEGORY(KTP_OTR)
+Q_DECLARE_LOGGING_CATEGORY(KTP_DECLARATIVE)
 
 #endif
diff --git a/KTp/Declarative/messages-model.cpp b/KTp/Declarative/messages-model.cpp
index 52c4844..8810a34 100644
--- a/KTp/Declarative/messages-model.cpp
+++ b/KTp/Declarative/messages-model.cpp
@@ -22,7 +22,7 @@
 
 #include <QPixmap>
 
-#include <KDebug>
+#include "debug.h"
 #include <KLocalizedString>
 #include <KConfig>
 
@@ -67,7 +67,7 @@ MessagesModel::MessagesModel(const Tp::AccountPtr &account, QObject *parent) :
         QAbstractListModel(parent),
         d(new MessagesModelPrivate)
 {
-    kDebug();
+    qCDebug(KTP_DECLARATIVE);
 
     QHash<int, QByteArray> roles;
     roles[TextRole] = "text";
@@ -103,7 +103,7 @@ bool MessagesModel::verifyPendingOperation(Tp::PendingOperation *op)
     bool operationSucceeded = true;
 
     if (op->isError()) {
-        kWarning() << op->errorName() << "+" << op->errorMessage();
+        qCWarning(KTP_DECLARATIVE) << op->errorName() << "+" << op->errorMessage();
         operationSucceeded = false;
     }
 
@@ -126,7 +126,7 @@ void MessagesModel::setupChannelSignals(const Tp::TextChannelPtr &channel)
 void MessagesModel::setTextChannel(const Tp::TextChannelPtr &channel)
 {
     Q_ASSERT(channel != d->textChannel);
-    kDebug();
+    qCDebug(KTP_DECLARATIVE);
     setupChannelSignals(channel);
 
     if (d->textChannel) {
@@ -161,7 +161,7 @@ void MessagesModel::setTextChannel(const Tp::TextChannelPtr &channel)
 
 void MessagesModel::onHistoryFetched(const QList<KTp::Message> &messages)
 {
-    kDebug() << "found" << messages.count() << "messages in history";
+    qCDebug(KTP_DECLARATIVE) << "found" << messages.count() << "messages in history";
     if (!messages.isEmpty()) {
         //Add all messages before the ones already present in the channel
         beginInsertRows(QModelIndex(), 0, messages.count() - 1);
@@ -176,21 +176,21 @@ void MessagesModel::onHistoryFetched(const QList<KTp::Message> &messages)
 void MessagesModel::onMessageReceived(const Tp::ReceivedMessage &message)
 {
     int unreadCount = d->textChannel->messageQueue().size();
-    kDebug() << "unreadMessagesCount =" << unreadCount;
-    kDebug() << "text =" << message.text();
-    kDebug() << "messageType = " << message.messageType();
-    kDebug() << "messageToken =" << message.messageToken();
+    qCDebug(KTP_DECLARATIVE) << "unreadMessagesCount =" << unreadCount;
+    qCDebug(KTP_DECLARATIVE) << "text =" << message.text();
+    qCDebug(KTP_DECLARATIVE) << "messageType = " << message.messageType();
+    qCDebug(KTP_DECLARATIVE) << "messageToken =" << message.messageToken();
 
     if (message.isDeliveryReport()) {
         d->textChannel->acknowledge(QList<Tp::ReceivedMessage>() << message);
 
         Tp::ReceivedMessage::DeliveryDetails deliveryDetails = message.deliveryDetails();
         if(!deliveryDetails.hasOriginalToken()) {
-            kDebug() << "Delivery report without original message token received.";
+            qCDebug(KTP_DECLARATIVE) << "Delivery report without original message token received.";
             // Matching the delivery report to the original message is impossible without the token.
             return;
         }
-        kDebug() << "originalMessageToken =" << deliveryDetails.originalToken();
+        qCDebug(KTP_DECLARATIVE) << "originalMessageToken =" << deliveryDetails.originalToken();
 
         QPersistentModelIndex originalMessageIndex = d->messagesByMessageToken.value(
                     deliveryDetails.originalToken());
@@ -200,7 +200,7 @@ void MessagesModel::onMessageReceived(const Tp::ReceivedMessage &message)
         }
 
         MessagePrivate &originalMessage = d->messages[originalMessageIndex.row()];
-        kDebug() << "Got delivery status" << deliveryDetails.status()
+        qCDebug(KTP_DECLARATIVE) << "Got delivery status" << deliveryDetails.status()
                  << "for message with text" << originalMessage.message.mainMessagePart();
         originalMessage.deliveryReportReceiveTime = message.received();
         switch(deliveryDetails.status()) {
@@ -208,7 +208,7 @@ void MessagesModel::onMessageReceived(const Tp::ReceivedMessage &message)
         case Tp::DeliveryStatusTemporarilyFailed:
             originalMessage.deliveryStatus = DeliveryStatusFailed;
             if (deliveryDetails.hasDebugMessage()) {
-                kDebug() << "Delivery failure debug message:" << deliveryDetails.debugMessage();
+                qCDebug(KTP_DECLARATIVE) << "Delivery failure debug message:" << deliveryDetails.debugMessage();
             }
             break;
         case Tp::DeliveryStatusDelivered:
@@ -245,7 +245,7 @@ void MessagesModel::onMessageSent(const Tp::Message &message, Tp::MessageSending
 
     int length = rowCount();
     beginInsertRows(QModelIndex(), length, length);
-    kDebug() << "text =" << message.text();
+    qCDebug(KTP_DECLARATIVE) << "text =" << message.text();
 
     const KTp::Message &newMessage = KTp::MessageProcessor::instance()->processIncomingMessage(
                 message, d->account, d->textChannel);
@@ -309,7 +309,7 @@ QVariant MessagesModel::data(const QModelIndex &index, int role) const
             break;
         };
     } else {
-        kError() << "Attempting to access data at invalid index (" << index << ")";
+        qWarning() << "Attempting to access data at invalid index (" << index << ")";
     }
 
     return result;
@@ -324,7 +324,7 @@ int MessagesModel::rowCount(const QModelIndex &parent) const
 void MessagesModel::sendNewMessage(const QString &message)
 {
     if (message.isEmpty()) {
-        kWarning() << "Attempting to send empty string";
+        qCWarning(KTP_DECLARATIVE) << "Attempting to send empty string";
     } else {
         Tp::PendingOperation *op;
         QString modifiedMessage = message;
@@ -365,7 +365,7 @@ void MessagesModel::acknowledgeAllMessages()
 {
     QList<Tp::ReceivedMessage> queue = d->textChannel->messageQueue();
 
-    kDebug() << "Conversation Visible, Acknowledging " << queue.size() << " messages.";
+    qCDebug(KTP_DECLARATIVE) << "Conversation Visible, Acknowledging " << queue.size() << " messages.";
 
     d->textChannel->acknowledge(queue);
     Q_EMIT unreadCountChanged(queue.size());
@@ -373,7 +373,7 @@ void MessagesModel::acknowledgeAllMessages()
 
 void MessagesModel::setVisibleToUser(bool visible)
 {
-    kDebug() << visible;
+    qCDebug(KTP_DECLARATIVE) << visible;
 
     if (d->visible != visible) {
         d->visible = visible;
@@ -392,7 +392,7 @@ bool MessagesModel::isVisibleToUser() const
 
 MessagesModel::~MessagesModel()
 {
-    kDebug();
+    qCDebug(KTP_DECLARATIVE);
     delete d;
 }
 
diff --git a/KTp/Declarative/pinned-contacts-model.cpp b/KTp/Declarative/pinned-contacts-model.cpp
index 155624f..4914328 100644
--- a/KTp/Declarative/pinned-contacts-model.cpp
+++ b/KTp/Declarative/pinned-contacts-model.cpp
@@ -29,9 +29,8 @@
 #include <TelepathyQt/ContactManager>
 #include <TelepathyQt/PendingContacts>
 
-#include <KComponentData>
 #include <KConfigGroup>
-#include <KDebug>
+#include "debug.h"
 
 #include "KTp/presence.h"
 #include "KTp/contact.h"
diff --git a/KTp/Declarative/telepathy-manager.cpp b/KTp/Declarative/telepathy-manager.cpp
index 0eef901..5630beb 100644
--- a/KTp/Declarative/telepathy-manager.cpp
+++ b/KTp/Declarative/telepathy-manager.cpp
@@ -22,7 +22,6 @@
 #include <Widgets/add-contact-dialog.h>
 #include <Widgets/settings-kcm-dialog.h>
 #include <KTp/actions.h>
-#include <kstandarddirs.h>
 #include <KToolInvocation>
 
 #include <TelepathyQt/Account>

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list