[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:25:03 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=8a2213f
The following commit has been merged in the master branch:
commit 8a2213f62afe9f6672f406d4b7f458b23cc40dbb
Author: Martin Klapetek <mklapetek at kde.org>
Date: Wed Jan 7 17:01:43 2015 +0100
[lib] KDebug -> QCDebug
---
lib/CMakeLists.txt | 1 +
lib/adium-theme-view.cpp | 36 +++++++++++-----------
lib/authenticationwizard.cpp | 21 ++++++-------
lib/channel-contact-model.cpp | 6 ++--
lib/chat-widget.cpp | 28 ++++++++---------
lib/chat-window-style-manager.cpp | 54 ++++++++++++++++-----------------
lib/chat-window-style.cpp | 26 ++++++++--------
lib/contact-delegate.cpp | 1 -
lib/{ktpchat_export.h => ktp-debug.cpp} | 27 +++--------------
lib/{ktpchat_export.h => ktp-debug.h} | 28 +++++------------
lib/proxy-service.cpp | 14 ++++-----
11 files changed, 103 insertions(+), 139 deletions(-)
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 2b2403c..2590752 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -20,6 +20,7 @@ set(ktpchat_SRCS
otr-status.cpp
authenticationwizard.cpp
otr-notifications.cpp
+ ktp-debug.cpp
)
set(ktpchat_UI
diff --git a/lib/adium-theme-view.cpp b/lib/adium-theme-view.cpp
index 16935d4..6c633d6 100644
--- a/lib/adium-theme-view.cpp
+++ b/lib/adium-theme-view.cpp
@@ -25,6 +25,7 @@
#include "adium-theme-status-info.h"
#include "chat-window-style-manager.h"
#include "chat-window-style.h"
+#include "ktp-debug.h"
#include <KTp/message-processor.h>
@@ -41,7 +42,6 @@
#include <QApplication>
#include <KAction>
-#include <KDebug>
#include <KEmoticonsTheme>
#include <KGlobal>
#include <KConfig>
@@ -226,7 +226,7 @@ void AdiumThemeView::initialise(const AdiumThemeHeaderInfo &chatInfo)
} else {
// FIXME: we should inform the user if the chatStyle want's to use a fontFamily which is not present on the system
QFontDatabase fontDB = QFontDatabase();
- kDebug() << "Theme font installed: " << m_chatStyle->defaultFontFamily()
+ qCDebug(KTP_TEXTUI_LIB) << "Theme font installed: " << m_chatStyle->defaultFontFamily()
<< fontDB.families().contains(m_chatStyle->defaultFontFamily());
// use theme fontFamily/Size, if not existent, it falls back to systems default font
@@ -298,11 +298,11 @@ void AdiumThemeView::initialise(const AdiumThemeHeaderInfo &chatInfo)
templateHtml.insert(index + 5, onload);
} else {
themeOnLoadJS = body.cap(2);
- //kDebug() << "Captured js onLoad" << themeOnLoadJS;
+ //qCDebug(KTP_TEXTUI_LIB) << "Captured js onLoad" << themeOnLoadJS;
templateHtml.replace(body.pos(1), body.cap(1).length(), onload);
}
}
- //kDebug() << templateHtml;
+ //qCDebug(KTP_TEXTUI_LIB) << templateHtml;
setHtml(templateHtml);
@@ -348,7 +348,7 @@ QString AdiumThemeView::fontFamily()
void AdiumThemeView::setFontFamily(QString fontFamily)
{
- kDebug();
+ qCDebug(KTP_TEXTUI_LIB);
m_fontFamily = fontFamily;
}
@@ -359,13 +359,13 @@ int AdiumThemeView::fontSize()
void AdiumThemeView::setFontSize(int fontSize)
{
- kDebug();
+ qCDebug(KTP_TEXTUI_LIB);
m_fontSize = fontSize;
}
void AdiumThemeView::setUseCustomFont(bool useCustomFont)
{
- kDebug();
+ qCDebug(KTP_TEXTUI_LIB);
m_useCustomFont = useCustomFont;
}
@@ -376,7 +376,7 @@ bool AdiumThemeView::isCustomFont() const
void AdiumThemeView::setShowPresenceChanges(bool showPresenceChanges)
{
- kDebug();
+ qCDebug(KTP_TEXTUI_LIB);
m_showPresenceChanges = showPresenceChanges;
}
@@ -515,7 +515,7 @@ void AdiumThemeView::addAdiumContentMessage(const AdiumThemeContentInfo &content
}
break;
default:
- kWarning() << "Unexpected message type to addContentMessage";
+ qCWarning(KTP_TEXTUI_LIB) << "Unexpected message type to addContentMessage";
}
replaceContentKeywords(styleHtml, message);
@@ -553,7 +553,7 @@ void AdiumThemeView::addAdiumStatusMessage(const AdiumThemeStatusInfo& statusMes
styleHtml = m_chatStyle->getStatusHistoryHtml();
break;
default:
- kWarning() << "Unexpected message type to addStatusMessage";
+ qCWarning(KTP_TEXTUI_LIB) << "Unexpected message type to addStatusMessage";
}
replaceStatusKeywords(styleHtml, message);
@@ -572,28 +572,28 @@ QString AdiumThemeView::appendScript(AdiumThemeView::AppendMode mode)
//escape quotes, and merge HTML onto one line.
switch (mode) {
case AppendMessageWithScroll:
- kDebug() << "AppendMessageWithScroll";
+ qCDebug(KTP_TEXTUI_LIB) << "AppendMessageWithScroll";
return QLatin1String("checkIfScrollToBottomIsNeeded(); appendMessage(\"%1\"); scrollToBottomIfNeeded(); false;");
case AppendNextMessageWithScroll:
- kDebug() << "AppendNextMessageWithScroll";
+ qCDebug(KTP_TEXTUI_LIB) << "AppendNextMessageWithScroll";
return QLatin1String("checkIfScrollToBottomIsNeeded(); appendNextMessage(\"%1\"); scrollToBottomIfNeeded(); false;");
case AppendMessage:
- kDebug() << "AppendMessage";
+ qCDebug(KTP_TEXTUI_LIB) << "AppendMessage";
return QLatin1String("appendMessage(\"%1\"); false;");
case AppendNextMessage:
- kDebug() << "AppendNextMessage";
+ qCDebug(KTP_TEXTUI_LIB) << "AppendNextMessage";
return QLatin1String("appendNextMessage(\"%1\"); false;");
case AppendMessageNoScroll:
- kDebug() << "AppendMessageNoScroll";
+ qCDebug(KTP_TEXTUI_LIB) << "AppendMessageNoScroll";
return QLatin1String("appendMessageNoScroll(\"%1\"); false;");
case AppendNextMessageNoScroll:
- kDebug() << "AppendNextMessageNoScroll";
+ qCDebug(KTP_TEXTUI_LIB) << "AppendNextMessageNoScroll";
return QLatin1String("appendNextMessageNoScroll(\"%1\"); false;");
case ReplaceLastMessage:
- kDebug() << "ReplaceLastMessage";
+ qCDebug(KTP_TEXTUI_LIB) << "ReplaceLastMessage";
return QLatin1String("replaceLastMessage(\"%1\"); false");
default:
- kWarning() << "Unhandled append mode!";
+ qCWarning(KTP_TEXTUI_LIB) << "Unhandled append mode!";
return QLatin1String("%1");
}
}
diff --git a/lib/authenticationwizard.cpp b/lib/authenticationwizard.cpp
index e0502bd..d1b50c1 100644
--- a/lib/authenticationwizard.cpp
+++ b/lib/authenticationwizard.cpp
@@ -20,10 +20,9 @@
*************************************************************************/
#include "authenticationwizard.h"
+#include "ktp-debug.h"
#include <KTp/OTR/channel-adapter.h>
-
-#include <KDebug>
#include <KLocale>
#include <KNotification>
#include <KIconLoader>
@@ -319,7 +318,7 @@ int AuthenticationWizard::nextId() const
bool AuthenticationWizard::validateCurrentPage()
{
- kDebug() << "currentId:" << currentId();
+ qCDebug(KTP_TEXTUI_LIB) << "currentId:" << currentId();
switch(currentId()) {
case 1:
if(initiate) {
@@ -348,7 +347,7 @@ bool AuthenticationWizard::validateCurrentPage()
void AuthenticationWizard::cancelVerification()
{
- kDebug() << "cancelVerification...";
+ qCDebug(KTP_TEXTUI_LIB) << "cancelVerification...";
if(!initiate){
chAdapter->abortPeerAuthentication();
}
@@ -356,7 +355,7 @@ void AuthenticationWizard::cancelVerification()
void AuthenticationWizard::nextState()
{
- kDebug();
+ qCDebug(KTP_TEXTUI_LIB);
if(currentId() == Page_Wait1) {
static_cast<WaitPage*>(currentPage())->ready();
next();
@@ -365,21 +364,21 @@ void AuthenticationWizard::nextState()
void AuthenticationWizard::finished(bool success)
{
- kDebug() << "authWizard finished";
+ qCDebug(KTP_TEXTUI_LIB) << "authWizard finished";
if(currentId() == Page_Wait2){
- kDebug() << "Yes, in wait_page2";
+ qCDebug(KTP_TEXTUI_LIB) << "Yes, in wait_page2";
static_cast<WaitPage*>(currentPage())->ready();
next();
if(success) {
- kDebug() << "auth succeeded";
+ qCDebug(KTP_TEXTUI_LIB) << "auth succeeded";
currentPage()->setTitle(i18n("Authentication successful"));
if(!question.isEmpty()|| rbQA->isChecked()) {
if(initiate){
- kDebug() << "initiate";
+ qCDebug(KTP_TEXTUI_LIB) << "initiate";
lFinal->setText(i18n("The authentication with <b>%1</b> has been completed successfully."
" The conversation is now secure.", contact));
} else {
- kDebug() << "not initiate";
+ qCDebug(KTP_TEXTUI_LIB) << "not initiate";
lFinal->setText(i18n("<b>%1</b> has successfully authenticated you."
" You may want to authenticate this contact as well by asking your own question.", contact));
}
@@ -435,7 +434,7 @@ void AuthenticationWizard::updateInfoBox(){
void AuthenticationWizard::notificationActivated( unsigned int id)
{
- kDebug() << "notificationActivated. ButtonId" << id;
+ qCDebug(KTP_TEXTUI_LIB) << "notificationActivated. ButtonId" << id;
if(id == 1) {
this->raise();
KWindowSystem::forceActiveWindow(this->winId());
diff --git a/lib/channel-contact-model.cpp b/lib/channel-contact-model.cpp
index 84ea767..3b12fef 100644
--- a/lib/channel-contact-model.cpp
+++ b/lib/channel-contact-model.cpp
@@ -19,11 +19,10 @@
#include "channel-contact-model.h"
#include "text-chat-config.h"
+#include "ktp-debug.h"
#include <QPixmap>
-#include <KDebug>
-
#include <KTp/types.h>
Q_DECLARE_METATYPE(Tp::ContactPtr)
@@ -130,7 +129,7 @@ void ChannelContactModel::onGroupMembersChanged(const Tp::Contacts &groupMembers
const Tp::Contacts &groupMembersRemoved,
const Tp::Channel::GroupMemberChangeDetails &details)
{
- kDebug();
+ qCDebug(KTP_TEXTUI_LIB);
Q_UNUSED(groupLocalPendingMembersAdded);
Q_UNUSED(groupRemotePendingMembersAdded);
@@ -224,4 +223,3 @@ void ChannelContactModel::onChatStateChanged(const Tp::ContactPtr &contact, Tp::
const QModelIndex index = createIndex(m_contacts.lastIndexOf(contact), 0);
dataChanged(index, index);
}
-
diff --git a/lib/chat-widget.cpp b/lib/chat-widget.cpp
index d6bbfea..66fbaa9 100644
--- a/lib/chat-widget.cpp
+++ b/lib/chat-widget.cpp
@@ -31,6 +31,7 @@
#include "contact-delegate.h"
#include "authenticationwizard.h"
#include "otr-notifications.h"
+#include "ktp-debug.h"
#include <QKeyEvent>
#include <QAction>
@@ -41,7 +42,6 @@
#include <KNotification>
#include <KAboutData>
#include <KComponentData>
-#include <KDebug>
#include <KColorScheme>
#include <KLineEdit>
#include <KMimeType>
@@ -411,7 +411,7 @@ void ChatWidget::temporaryFileTransferStateChanged(Tp::FileTransferState state,
QString localFile = QUrl(channel->uri()).toLocalFile();
if (QFile::exists(localFile)) {
QFile::remove(localFile);
- kDebug() << "File" << localFile << "removed";
+ qCDebug(KTP_TEXTUI_LIB) << "File" << localFile << "removed";
}
d->tmpFileTransfers.removeAll(Tp::OutgoingFileTransferChannelPtr(channel));
@@ -493,7 +493,7 @@ void ChatWidget::dropEvent(QDropEvent *e)
d->fileToTransferPath = tmpFile.fileName();
d->fileResourceTransferMenu->popup(mapToGlobal(e->pos()));
- kDebug() << "Starting Uploading of" << tmpFile.fileName();
+ qCDebug(KTP_TEXTUI_LIB) << "Starting Uploading of" << tmpFile.fileName();
e->acceptProposedAction();
}
@@ -527,12 +527,12 @@ QColor ChatWidget::titleColor() const
KColorScheme scheme(QPalette::Active, KColorScheme::Window);
if (TextChatConfig::instance()->showOthersTyping() && (d->remoteContactChatState == Tp::ChannelChatStateComposing)) {
- kDebug() << "remote is typing";
+ qCDebug(KTP_TEXTUI_LIB) << "remote is typing";
return scheme.foreground(KColorScheme::PositiveText).color();
}
if (unreadMessageCount() > 0 && !isOnTop()) {
- kDebug() << "unread messages";
+ qCDebug(KTP_TEXTUI_LIB) << "unread messages";
return scheme.foreground(KColorScheme::ActiveText).color();
}
@@ -605,7 +605,7 @@ void ChatWidget::onHistoryFetched(const QList<KTp::Message> &messages)
{
d->chatViewInitialized = true;
- kDebug() << "found" << messages.count() << "messages in history";
+ qCDebug(KTP_TEXTUI_LIB) << "found" << messages.count() << "messages in history";
if (!messages.isEmpty()) {
QDate date = messages.first().time().date();
Q_FOREACH(const KTp::Message &message, messages) {
@@ -635,7 +635,7 @@ int ChatWidget::unreadMessageCount() const
void ChatWidget::acknowledgeMessages()
{
- kDebug();
+ qCDebug(KTP_TEXTUI_LIB);
//if we're not initialised we can't have shown anything, even if we are on top, therefore ignore all requests to do so
if (d->chatViewInitialized) {
//acknowledge everything in the message queue.
@@ -654,7 +654,7 @@ void ChatWidget::updateSendMessageShortcuts(const QKeySequence &shortcuts)
bool ChatWidget::isOnTop() const
{
- kDebug() << ( isActiveWindow() && isVisible() );
+ qCDebug(KTP_TEXTUI_LIB) << ( isActiveWindow() && isVisible() );
return ( isActiveWindow() && isVisible() );
}
@@ -699,7 +699,7 @@ void ChatWidget::startOtrSession()
void ChatWidget::stopOtrSession()
{
- kDebug();
+ qCDebug(KTP_TEXTUI_LIB);
if(!d->channel->isOTRsuppored() || d->channel->otrTrustLevel() == KTp::OTRTrustLevelNotPrivate) {
return;
}
@@ -731,7 +731,7 @@ void ChatWidget::authenticateBuddy()
void ChatWidget::setupOTR()
{
- kDebug();
+ qCDebug(KTP_TEXTUI_LIB);
connect(d->channel.data(), SIGNAL(otrTrustLevelChanged(KTp::OTRTrustLevel, KTp::OTRTrustLevel)),
SLOT(onOTRTrustLevelChanged(KTp::OTRTrustLevel, KTp::OTRTrustLevel)));
@@ -755,7 +755,7 @@ void ChatWidget::setupOTR()
void ChatWidget::onOTRTrustLevelChanged(KTp::OTRTrustLevel trustLevel, KTp::OTRTrustLevel previous)
{
- kDebug();
+ qCDebug(KTP_TEXTUI_LIB);
d->hasNewOTRstatus = true;
switch(trustLevel) {
@@ -870,7 +870,7 @@ void ChatWidget::onPeerAuthenticationFailed()
void ChatWidget::handleIncomingMessage(const Tp::ReceivedMessage &message, bool alreadyNotified)
{
- kDebug() << title() << message.text();
+ qCDebug(KTP_TEXTUI_LIB) << title() << message.text();
if (d->chatViewInitialized) {
@@ -892,7 +892,7 @@ void ChatWidget::handleIncomingMessage(const Tp::ReceivedMessage &message, bool
Tp::ReceivedMessage::DeliveryDetails reportDetails = message.deliveryDetails();
if (reportDetails.hasDebugMessage()) {
- kDebug() << "delivery report debug message: " << reportDetails.debugMessage();
+ qCDebug(KTP_TEXTUI_LIB) << "delivery report debug message: " << reportDetails.debugMessage();
}
if (reportDetails.isError()) {
@@ -960,7 +960,7 @@ void ChatWidget::handleIncomingMessage(const Tp::ReceivedMessage &message, bool
}
} else {
//TODO: handle delivery reports properly
- kWarning() << "Ignoring delivery report";
+ qCWarning(KTP_TEXTUI_LIB) << "Ignoring delivery report";
d->channel->acknowledge(QList<Tp::ReceivedMessage>() << message);
return;
}
diff --git a/lib/chat-window-style-manager.cpp b/lib/chat-window-style-manager.cpp
index 196c362..c63326c 100644
--- a/lib/chat-window-style-manager.cpp
+++ b/lib/chat-window-style-manager.cpp
@@ -18,6 +18,7 @@
#include "chat-window-style-manager.h"
#include "chat-style-plist-file-reader.h"
#include "chat-window-style.h"
+#include "ktp-debug.h"
// Qt includes
#include <QtCore/QStack>
@@ -27,7 +28,6 @@
// KDE includes
#include <KDirLister>
-#include <KDebug>
#include <KUrl>
#include <KGlobal>
#include <KArchive>
@@ -72,12 +72,12 @@ ChatWindowStyleManager *ChatWindowStyleManager::self()
ChatWindowStyleManager::ChatWindowStyleManager(QObject *parent)
: QObject(parent), d(new Private(this))
{
- kDebug() ;
+ qCDebug(KTP_TEXTUI_LIB);
}
ChatWindowStyleManager::~ChatWindowStyleManager()
{
- kDebug() ;
+ qCDebug(KTP_TEXTUI_LIB);
delete d;
}
@@ -88,7 +88,7 @@ void ChatWindowStyleManager::loadStyles()
QStringList chatStyles = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QLatin1String("ktelepathy/styles"), QStandardPaths::LocateDirectory);
Q_FOREACH(const QString &styleDir, chatStyles) {
- kDebug() << styleDir;
+ qCDebug(KTP_TEXTUI_LIB) << styleDir;
d->styleDirs.push(KUrl(styleDir));
}
@@ -116,14 +116,14 @@ int ChatWindowStyleManager::installStyle(const QString &styleBundlePath)
QStringList chatStyles = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QLatin1String("ktelepathy/styles"), QStandardPaths::LocateDirectory);
// findDirs returns preferred paths first, let's check if one of them is writable
Q_FOREACH(const QString& styleDir, chatStyles) {
- kDebug() << styleDir;
+ qCDebug(KTP_TEXTUI_LIB) << styleDir;
if (QFileInfo(styleDir).isWritable()) {
localStyleDir = styleDir;
break;
}
}
if (localStyleDir.isEmpty()) { // none of dirs is writable
- kDebug()<< "not writable";
+ qCDebug(KTP_TEXTUI_LIB)<< "not writable";
return StyleNoDirectoryValid;
}
@@ -143,23 +143,23 @@ int ChatWindowStyleManager::installStyle(const QString &styleBundlePath)
archive = new KZip(styleBundlePath);
if (!archive->open(QIODevice::ReadOnly)) {
delete archive;
- kDebug() << "!zip";
+ qCDebug(KTP_TEXTUI_LIB) << "!zip";
archive = new KTar(styleBundlePath);
if (!archive->open(QIODevice::ReadOnly)) {
delete archive;
- kDebug() << "!tar" << styleBundlePath;
+ qCDebug(KTP_TEXTUI_LIB) << "!tar" << styleBundlePath;
return StyleCannotOpen;
}
}
} else {
- kDebug() << "unsupported file type" << currentBundleMimeType;
- kDebug() << styleBundlePath;
+ qCDebug(KTP_TEXTUI_LIB) << "unsupported file type" << currentBundleMimeType;
+ qCDebug(KTP_TEXTUI_LIB) << styleBundlePath;
return StyleUnknow;
}
if (archive == 0 || !archive->open(QIODevice::ReadOnly)) {
delete archive;
- kDebug() << "cannot open theme file";
+ qCDebug(KTP_TEXTUI_LIB) << "cannot open theme file";
return StyleCannotOpen;
}
@@ -177,22 +177,22 @@ int ChatWindowStyleManager::installStyle(const QString &styleBundlePath)
QStringList::ConstIterator entriesIt;
for (entriesIt = entries.begin(); entriesIt != entries.end(); ++entriesIt) {
currentEntry = const_cast<KArchiveEntry*>(rootDir->entry(*entriesIt));
- kDebug() << "Current entry name: " << currentEntry->name();
+ qCDebug(KTP_TEXTUI_LIB) << "Current entry name: " << currentEntry->name();
if (currentEntry->isDirectory()) {
currentDir = dynamic_cast<KArchiveDirectory*>(currentEntry);
if (currentDir) {
if (currentDir->entry(QLatin1String("Contents"))) {
- kDebug() << "Contents found";
+ qCDebug(KTP_TEXTUI_LIB) << "Contents found";
validResult += 1;
}
if (currentDir->entry(QLatin1String("Contents/Resources"))) {
- kDebug() << "Contents/Resources found";
+ qCDebug(KTP_TEXTUI_LIB) << "Contents/Resources found";
validResult += 1;
}
}
}
}
- kDebug() << "Valid result: " << QString::number(validResult);
+ qCDebug(KTP_TEXTUI_LIB) << "Valid result: " << QString::number(validResult);
// The archive is a valid style bundle.
if (validResult >= 2) {
bool installOk = false;
@@ -224,7 +224,7 @@ int ChatWindowStyleManager::installStyle(const QString &styleBundlePath)
archive->close();
delete archive;
- kDebug() << "style not valid";
+ qCDebug(KTP_TEXTUI_LIB) << "style not valid";
return StyleNotValid;
}
@@ -239,7 +239,7 @@ int ChatWindowStyleManager::installStyle(const QString &styleBundlePath)
bool ChatWindowStyleManager::removeStyle(const QString &styleId)
{
Q_UNUSED(styleId)
-// kDebug() << styleId;
+// qCDebug(KTP_TEXTUI_LIB) << styleId;
// // Find for the current style in avaiableStyles map.
// int foundStyleIdx = d->availableStyles.indexOf(styleId);
@@ -255,7 +255,7 @@ bool ChatWindowStyleManager::removeStyle(const QString &styleId)
// QStringList styleDirs = KGlobal::dirs()->findDirs("appdata", QString("styles/%1").arg(styleId));
// if (styleDirs.isEmpty()) {
-// kDebug() << "Failed to find style" << styleId;
+// qCDebug(KTP_TEXTUI_LIB) << "Failed to find style" << styleId;
// return false;
// }
@@ -282,14 +282,14 @@ ChatWindowStyle *ChatWindowStyleManager::getValidStyleFromPool(const QString &st
return style;
}
- kDebug() << "Trying default style";
+ qCDebug(KTP_TEXTUI_LIB) << "Trying default style";
// Try default style
style = getStyleFromPool(QLatin1String("renkoo.AdiumMessageStyle"));
if (style) {
return style;
}
- kDebug() << "Trying first valid style";
+ qCDebug(KTP_TEXTUI_LIB) << "Trying first valid style";
// Try first valid style
Q_FOREACH(const QString& name, d->availableStyles) {
style = getStyleFromPool(name);
@@ -298,14 +298,14 @@ ChatWindowStyle *ChatWindowStyleManager::getValidStyleFromPool(const QString &st
}
}
- kDebug() << "Valid style not found!";
+ qCDebug(KTP_TEXTUI_LIB) << "Valid style not found!";
return 0;
}
ChatWindowStyle *ChatWindowStyleManager::getStyleFromPool(const QString &styleId)
{
if (d->stylePool.contains(styleId)) {
- kDebug() << styleId << " was on the pool";
+ qCDebug(KTP_TEXTUI_LIB) << styleId << " was on the pool";
// NOTE: This is a hidden config switch for style developers
// Check in the config if the cache is disabled.
@@ -322,13 +322,13 @@ ChatWindowStyle *ChatWindowStyleManager::getStyleFromPool(const QString &styleId
// Build a chat window style and list its variants, then add it to the pool.
ChatWindowStyle *style = new ChatWindowStyle(styleId, ChatWindowStyle::StyleBuildNormal);
if (!style->isValid()) {
- kDebug() << styleId << " is invalid style!";
+ qCDebug(KTP_TEXTUI_LIB) << styleId << " is invalid style!";
delete style;
return 0;
}
d->stylePool.insert(styleId, style);
- kDebug() << styleId << " is just created";
+ qCDebug(KTP_TEXTUI_LIB) << styleId << " is just created";
return style;
}
@@ -338,12 +338,12 @@ void ChatWindowStyleManager::slotNewStyles(const KFileItemList &dirList)
Q_FOREACH(const KFileItem &item, dirList) {
// Ignore data dir(from deprecated XSLT themes)
if (!item.url().fileName().contains(QLatin1String("data"))) {
- kDebug() << "Listing: " << item.url().fileName();
+ qCDebug(KTP_TEXTUI_LIB) << "Listing: " << item.url().fileName();
// If the style path is already in the pool, that's mean the style was updated on disk
// Reload the style
QString styleId = item.url().fileName();
if (d->stylePool.contains(styleId)) {
- kDebug() << "Updating style: " << styleId;
+ qCDebug(KTP_TEXTUI_LIB) << "Updating style: " << styleId;
d->stylePool[styleId]->reload();
@@ -374,7 +374,7 @@ void ChatWindowStyleManager::slotDirectoryFinished()
{
// Start another scanning if the directories stack is not empty
if (!d->styleDirs.isEmpty()) {
- kDebug() << "Starting another directory.";
+ qCDebug(KTP_TEXTUI_LIB) << "Starting another directory.";
d->styleDirLister->openUrl(d->styleDirs.pop(), KDirLister::Keep);
} else {
Q_EMIT loadStylesFinished();
diff --git a/lib/chat-window-style.cpp b/lib/chat-window-style.cpp
index f2c5339..f0dde49 100644
--- a/lib/chat-window-style.cpp
+++ b/lib/chat-window-style.cpp
@@ -17,6 +17,7 @@
#include "chat-window-style.h"
#include "chat-style-plist-file-reader.h"
+#include "ktp-debug.h"
// Qt includes
#include <QtCore/QFile>
@@ -31,7 +32,6 @@
#include <QFontDatabase>
// KDE includes
-#include <KDebug>
#include <KLocale>
class ChatWindowStyle::Private
@@ -56,12 +56,12 @@ ChatWindowStyle::ChatWindowStyle(const QString &styleId, StyleBuildMode styleBui
{
init(styleId, styleBuildMode);
- kDebug() << "Style" << styleId << ":";
- kDebug() << "messageViewVersion is" << d->messageViewVersion;
- kDebug() << "disableCombineConsecutive is" << d->disableCombineConsecutive;
- kDebug() << "hasCustomTemplateHtml is" << d->hasCustomTemplateHtml;
+ qCDebug(KTP_TEXTUI_LIB) << "Style" << styleId << ":";
+ qCDebug(KTP_TEXTUI_LIB) << "messageViewVersion is" << d->messageViewVersion;
+ qCDebug(KTP_TEXTUI_LIB) << "disableCombineConsecutive is" << d->disableCombineConsecutive;
+ qCDebug(KTP_TEXTUI_LIB) << "hasCustomTemplateHtml is" << d->hasCustomTemplateHtml;
if (d->messageViewVersion < 3) {
- kWarning() << "Style" << styleId << "is legacy";
+ qCWarning(KTP_TEXTUI_LIB) << "Style" << styleId << "is legacy";
}
}
@@ -82,15 +82,15 @@ void ChatWindowStyle::init(const QString &styleId, StyleBuildMode styleBuildMode
QStandardPaths::LocateDirectory);
if (styleDirs.isEmpty()) {
- kDebug() << "Failed to find style" << styleId;
+ qCDebug(KTP_TEXTUI_LIB) << "Failed to find style" << styleId;
return;
}
d->styleId = styleId;
if (styleDirs.count() > 1) {
- kDebug() << "found several styles with the same name. using first";
+ qCDebug(KTP_TEXTUI_LIB) << "found several styles with the same name. using first";
}
d->baseHref = styleDirs.at(0);
- kDebug() << "Using style:" << d->baseHref;
+ qCDebug(KTP_TEXTUI_LIB) << "Using style:" << d->baseHref;
readStyleFiles();
if (styleBuildMode & StyleBuildNormal) {
listVariants();
@@ -352,7 +352,7 @@ void ChatWindowStyle::readStyleFiles()
// If name is still empty we use "Normal"
d->defaultVariantName = i18nc("Normal style variant menu item", "Normal");
}
- kDebug() << "defaultVariantName = " << d->defaultVariantName;
+ qCDebug(KTP_TEXTUI_LIB) << "defaultVariantName = " << d->defaultVariantName;
d->defaultFontFamily = plistReader.defaultFontFamily().isEmpty() ? QFontDatabase::systemFont(QFontDatabase::GeneralFont).family()
: plistReader.defaultFontFamily();
@@ -409,12 +409,12 @@ void ChatWindowStyle::readStyleFiles()
headerStream.setCodec(QTextCodec::codecForName("UTF-8"));
QString data = headerStream.readAll();
if(!data.isEmpty()) {
- //kDebug() << fileName << "was found!";
+ //qCDebug(KTP_TEXTUI_LIB) << fileName << "was found!";
setContent( templateFiles.key(fileName), data);
} else {
- kDebug() << fileName << "was not found!";
+ qCDebug(KTP_TEXTUI_LIB) << fileName << "was not found!";
}
- //kDebug() << fileName << content(templateFiles.key(fileName));
+ //qCDebug(KTP_TEXTUI_LIB) << fileName << content(templateFiles.key(fileName));
fileAccess.close();
}
}
diff --git a/lib/contact-delegate.cpp b/lib/contact-delegate.cpp
index a0986bc..b6e7959 100644
--- a/lib/contact-delegate.cpp
+++ b/lib/contact-delegate.cpp
@@ -31,7 +31,6 @@
#include <QFontDatabase>
#include <KIconLoader>
-#include <KDebug>
#include <KLocale>
#include <KTp/types.h>
diff --git a/lib/ktpchat_export.h b/lib/ktp-debug.cpp
similarity index 55%
copy from lib/ktpchat_export.h
copy to lib/ktp-debug.cpp
index ee6bcc3..a3bc00f 100644
--- a/lib/ktpchat_export.h
+++ b/lib/ktp-debug.cpp
@@ -1,5 +1,5 @@
-/* This file is part of the KDE project
- Copyright (C) 2007 David Faure <faure at kde.org>
+/*
+ Copyright (C) 2015 Martin Klapetek <mklapetek at kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -17,24 +17,5 @@
Boston, MA 02110-1301, USA.
*/
-#ifndef KDETELEPATHYCHAT_EXPORT_H
-#define KDETELEPATHYCHAT_EXPORT_H
-
-/* needed for KDE_EXPORT and KDE_IMPORT macros */
-#include <kdemacros.h>
-
-#ifndef KDE_TELEPATHY_CHAT_EXPORT
-# if defined(MAKE_KTPCHAT_LIB)
- /* We are building this library */
-# define KDE_TELEPATHY_CHAT_EXPORT KDE_EXPORT
-# else
- /* We are using this library */
-# define KDE_TELEPATHY_CHAT_EXPORT KDE_IMPORT
-# endif
-#endif
-
-# ifndef KDE_TELEPATHY_CHAT_EXPORT_DEPRECATED
-# define KDE_TELEPATHY_CHAT_EXPORT_DEPRECATED KDE_DEPRECATED KDE_TELEPATHY_CHAT_EXPORT
-# endif
-
-#endif
+#include "ktp-debug.h"
+Q_LOGGING_CATEGORY(KTP_TEXTUI_LIB, "ktp-textui-lib")
diff --git a/lib/ktpchat_export.h b/lib/ktp-debug.h
similarity index 55%
copy from lib/ktpchat_export.h
copy to lib/ktp-debug.h
index ee6bcc3..1f9be11 100644
--- a/lib/ktpchat_export.h
+++ b/lib/ktp-debug.h
@@ -1,5 +1,5 @@
-/* This file is part of the KDE project
- Copyright (C) 2007 David Faure <faure at kde.org>
+/*
+ Copyright (C) 2015 Martin Klapetek <mklapetek at kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -17,24 +17,10 @@
Boston, MA 02110-1301, USA.
*/
-#ifndef KDETELEPATHYCHAT_EXPORT_H
-#define KDETELEPATHYCHAT_EXPORT_H
-
-/* needed for KDE_EXPORT and KDE_IMPORT macros */
-#include <kdemacros.h>
-
-#ifndef KDE_TELEPATHY_CHAT_EXPORT
-# if defined(MAKE_KTPCHAT_LIB)
- /* We are building this library */
-# define KDE_TELEPATHY_CHAT_EXPORT KDE_EXPORT
-# else
- /* We are using this library */
-# define KDE_TELEPATHY_CHAT_EXPORT KDE_IMPORT
-# endif
-#endif
-
-# ifndef KDE_TELEPATHY_CHAT_EXPORT_DEPRECATED
-# define KDE_TELEPATHY_CHAT_EXPORT_DEPRECATED KDE_DEPRECATED KDE_TELEPATHY_CHAT_EXPORT
-# endif
+#ifndef KTP_TEXTUI_LIB_DEBUG_H
+#define KTP_TEXTUI_LIB_DEBUG_H
+#include <QDebug>
+#include <QLoggingCategory>
+Q_DECLARE_LOGGING_CATEGORY(KTP_TEXTUI_LIB)
#endif
diff --git a/lib/proxy-service.cpp b/lib/proxy-service.cpp
index da3a363..8ac4e25 100644
--- a/lib/proxy-service.cpp
+++ b/lib/proxy-service.cpp
@@ -17,13 +17,13 @@
#include "proxy-service.h"
#include "ui_keygendialog.h"
+#include "ktp-debug.h"
#include <KTp/OTR/proxy-service-interface.h>
#include <QMap>
#include <QScopedPointer>
#include <QCloseEvent>
-#include <KDebug>
#include <KDialog>
#include <KLocale>
@@ -47,7 +47,7 @@ class KeyGenDialog : public KDialog
}
~KeyGenDialog()
{
- kDebug() << "Destructing";
+ qCDebug(KTP_TEXTUI_LIB) << "Destructing";
}
void block()
@@ -142,7 +142,7 @@ QString ProxyService::fingerprintForAccount(const QDBusObjectPath& account) cons
if(rep.isValid()) {
return rep.value();
} else {
- kWarning() << "Could not get fingerprint of account: " << account.path() <<
+ qCWarning(KTP_TEXTUI_LIB) << "Could not get fingerprint of account: " << account.path() <<
" due to: " << rep.error().message();
return QLatin1String("");
}
@@ -155,7 +155,7 @@ KTp::FingerprintInfoList ProxyService::knownFingerprints(const QDBusObjectPath &
if(fpsRep.isValid()) {
return fpsRep.value();
} else {
- kWarning() << "Could not get known fingerprints for account: " << account.path() <<
+ qCWarning(KTP_TEXTUI_LIB) << "Could not get known fingerprints for account: " << account.path() <<
" due to: " << fpsRep.error().message();
return KTp::FingerprintInfoList();
}
@@ -168,7 +168,7 @@ bool ProxyService::trustFingerprint(const QDBusObjectPath &account, const QStrin
if(res.isValid()) {
return true;
} else {
- kWarning() << "Could not trust fingerprint " << fingerprint << " for account: " << account.path() <<
+ qCWarning(KTP_TEXTUI_LIB) << "Could not trust fingerprint " << fingerprint << " for account: " << account.path() <<
" due to: " << res.error().message();
return false;
}
@@ -181,7 +181,7 @@ bool ProxyService::forgetFingerprint(const QDBusObjectPath &account, const QStri
if(res.isValid()) {
return true;
} else {
- kWarning() << "Could not forget fingerprint " << fingerprint << " for account: " << account.path() <<
+ qCWarning(KTP_TEXTUI_LIB) << "Could not forget fingerprint " << fingerprint << " for account: " << account.path() <<
" due to: " << res.error().message();
return false;
}
@@ -199,7 +199,7 @@ Tp::PendingOperation* ProxyService::setOTRPolicy(uint policy)
void ProxyService::onKeyGenerationStarted(const QDBusObjectPath &accountPath)
{
- kDebug();
+ qCDebug(KTP_TEXTUI_LIB);
KeyGenDialog *dialog = new KeyGenDialog(
d->am->accountForObjectPath(accountPath.path())->normalizedName(),
d->parent);
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list