Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 4227cb32 authored by Laurent Montel's avatar Laurent Montel 😁 Committed by Pali Rohár

Port to debug category

parent 1bde39f6
......@@ -2,3 +2,4 @@ org.kde.kopete.libkopete kopete (libkopete)
org.kde.kopete.jabber kopete (jabber protocol)
org.kde.kopete.plugin.otr kopete (otr plugin)
org.kde.plugin.texteffect kopete (texteffect plugin)
org.kde.kopete.chatwindow kopete (chatwindow)
......@@ -46,6 +46,7 @@ set(kopete_SRCS
)
qt5_add_dbus_adaptor(kopete_SRCS org.kde.Kopete.xml kopetedbusinterface.h KopeteDBusInterface)
ecm_qt_declare_logging_category(kopete_SRCS HEADER kopete_debug.h IDENTIFIER KOPETE_LOG CATEGORY_NAME org.kde.kopete.kopete)
ki18n_wrap_ui(kopete_SRCS groupkabcselectorwidget.ui infoeventbase.ui )
......
......@@ -10,6 +10,8 @@ include_directories(
link_directories( ${CMAKE_CURRENT_BINARY_DIR} )
########### next target ###############
set(kopetechatwindow_shared_common_SRCS)
ecm_qt_declare_logging_category(kopetechatwindow_shared_common_SRCS HEADER kopetechatwindow_debug.h IDENTIFIER KOPETE_CHATEWINDOW_LOG CATEGORY_NAME org.kde.kopete.chatwindow)
set( kopetechatwindow_shared_SRCS
chatmessagepart.cpp
......@@ -18,7 +20,8 @@ set( kopetechatwindow_shared_SRCS
chattexteditpart.cpp
kopeterichtextwidget.cpp
kopetechatwindowstylemanager.cpp
kopetechatwindowstyle.cpp )
kopetechatwindowstyle.cpp
${kopetechatwindow_shared_common_SRCS})
kconfig_add_kcfg_files(kopetechatwindow_shared_SRCS GENERATE_MOC kopetechatwindowsettings.kcfgc )
......@@ -42,7 +45,7 @@ install(TARGETS chattexteditpart DESTINATION ${KDE_INSTALL_PLUGINDIR})
########### next target ###############
set(kopete_chatwindow_PART_SRCS chatview.cpp kopetechatwindow.cpp chatmemberslistview.cpp)
set(kopete_chatwindow_PART_SRCS chatview.cpp kopetechatwindow.cpp chatmemberslistview.cpp ${kopetechatwindow_shared_common_SRCS})
add_library(kopete_chatwindow MODULE ${kopete_chatwindow_PART_SRCS})
......
......@@ -66,7 +66,7 @@
// KDE includes
#include <KFormat>
#include <kactioncollection.h>
#include <kdebug.h>
#include "kopetechatwindow_debug.h"
#include <khtmlview.h>
#include <KLocalizedString>
......@@ -297,7 +297,7 @@ ChatMessagePart::ChatMessagePart(Kopete::ChatSession *mgr, QWidget *parent)
ChatMessagePart::~ChatMessagePart()
{
kDebug(14000);
qCDebug(KOPETE_CHATEWINDOW_LOG);
// Cancel all pending file transfer requests
QList<Kopete::Message>::ConstIterator it, itEnd = d->allMessages.constEnd();
......@@ -377,7 +377,7 @@ void ChatMessagePart::pageDown()
void ChatMessagePart::slotOpenURLRequest(const QUrl &url, const KParts::OpenUrlArguments &, const KParts::BrowserArguments &)
{
kDebug(14000) << "url=" << url.url();
qCDebug(KOPETE_CHATEWINDOW_LOG) << "url=" << url.url();
if (url.scheme() == QLatin1String("kopetemessage")) {
Kopete::Contact *contact = d->manager->account()->contacts().value(url.host());
if (contact) {
......@@ -493,7 +493,7 @@ void ChatMessagePart::appendMessage(Kopete::Message &message, bool restoring)
DOM::HTMLElement chatNode = htmlDocument().getElementById("Chat");
if (chatNode.isNull()) {
kDebug(14000) << "WARNING: Chat Node was null !";
qCDebug(KOPETE_CHATEWINDOW_LOG) << "WARNING: Chat Node was null !";
return;
}
......@@ -624,7 +624,7 @@ void ChatMessagePart::appendMessage(Kopete::Message &message, bool restoring)
}
#ifdef STYLE_TIMETEST
kDebug(14000) << "Message time: " << beforeMessage.msecsTo(QTime::currentTime());
qCDebug(KOPETE_CHATEWINDOW_LOG) << "Message time: " << beforeMessage.msecsTo(QTime::currentTime());
#endif
}
......@@ -1021,7 +1021,7 @@ QString ChatMessagePart::formatStyleKeywords(const QString &sourceHTML, const Ko
// Replace messages.
// Build the action message if the currentChatStyle do not have Action template.
if (message.type() == Kopete::Message::TypeAction && !d->currentChatStyle->hasActionTemplate()) {
kDebug(14000) << "Map Action message to Status template. ";
qCDebug(KOPETE_CHATEWINDOW_LOG) << "Map Action message to Status template. ";
QString boldNick = QStringLiteral("%1<b>%2</b></a> ").arg(nickLink, nick);
QString newBody = boldNick + message.parsedBody();
......@@ -1049,7 +1049,7 @@ QString ChatMessagePart::formatStyleKeywords(const QString &sourceHTML, const Ko
}
const QString colorName = nameColors[ hash % nameColorsLen ];
QString lightColorName; // Do not initialize, QColor::name() is expensive!
//kDebug(14000) << "Hash " << hash << " has color " << colorName;
//qCDebug(KOPETE_CHATEWINDOW_LOG) << "Hash " << hash << " has color " << colorName;
QRegExp senderColorRegExp("%senderColor(?:\\{([^}]*)\\})?%");
textPos = 0;
while ((textPos = senderColorRegExp.indexIn(resultHTML, textPos)) != -1)
......@@ -1243,7 +1243,7 @@ QString ChatMessagePart::formatMessageBody(const Kopete::Message &message)
void ChatMessagePart::slotUpdateHeaderDisplayName()
{
kDebug(14000);
qCDebug(KOPETE_CHATEWINDOW_LOG);
DOM::HTMLElement kopeteChatNameNode = document().getElementById(QStringLiteral("KopeteHeaderChatNameInternal"));
if (!kopeteChatNameNode.isNull()) {
kopeteChatNameNode.setInnerText(formatName(d->manager->displayName(), Qt::RichText));
......@@ -1274,15 +1274,15 @@ void ChatMessagePart::changeStyle()
Kopete::Message tempMessage = *it;
appendMessage(tempMessage, true); // true means that we are restoring.
}
kDebug(14000) << "Finish changing style.";
qCDebug(KOPETE_CHATEWINDOW_LOG) << "Finish changing style.";
#ifdef STYLE_TIMETEST
kDebug(14000) << "Change time: " << beforeChange.msecsTo(QTime::currentTime());
qCDebug(KOPETE_CHATEWINDOW_LOG) << "Change time: " << beforeChange.msecsTo(QTime::currentTime());
#endif
}
void ChatMessagePart::writeTemplate()
{
kDebug(14000);
qCDebug(KOPETE_CHATEWINDOW_LOG);
#ifdef STYLE_TIMETEST
QTime beforeHeader = QTime::currentTime();
......@@ -1337,7 +1337,7 @@ void ChatMessagePart::writeTemplate()
write(xhtmlBase);
end();
#ifdef STYLE_TIMETEST
kDebug(14000) << "Header time: " << beforeHeader.msecsTo(QTime::currentTime());
qCDebug(KOPETE_CHATEWINDOW_LOG) << "Header time: " << beforeHeader.msecsTo(QTime::currentTime());
#endif
}
......
......@@ -30,7 +30,7 @@
#include <QColorDialog>
#include <kconfig.h>
#include <kcompletion.h>
#include <kdebug.h>
#include "kopetechatwindow_debug.h"
#include <kfontaction.h>
#include <kfontsizeaction.h>
#include <kglobalsettings.h>
......@@ -154,7 +154,7 @@ void ChatTextEditPart::complete()
}
}
//kDebug(14000) << word << "from" << txt
//qCDebug(KOPETE_CHATEWINDOW_LOG) << word << "from" << txt
// << "cursor pos=" << cursorPos
// << "start pos=" << startPos << "end pos=" << endPos;
......@@ -173,16 +173,16 @@ void ChatTextEditPart::complete()
match += QLatin1String(": ");
}
//kDebug(14000) << "Selecting from position" << cursorPos << "to position" << endPos;
//qCDebug(KOPETE_CHATEWINDOW_LOG) << "Selecting from position" << cursorPos << "to position" << endPos;
// Select the text to remove
textCursor.setPosition(startPos + blockPosition);
textCursor.setPosition(endPos + blockPosition, QTextCursor::KeepAnchor);
//kDebug(14000) << "replacing selection:" << textCursor.selectedText() << "with match:" << match;
//qCDebug(KOPETE_CHATEWINDOW_LOG) << "replacing selection:" << textCursor.selectedText() << "with match:" << match;
// Type the text to replace it
textCursor.insertText(match);
textEdit()->setTextCursor(textCursor);
} else {
//kDebug(14000) << "No completions! Tried" << mComplete->items();
//qCDebug(KOPETE_CHATEWINDOW_LOG) << "No completions! Tried" << mComplete->items();
}
}
......
......@@ -38,7 +38,7 @@
#include <KUrlMimeData>
#include <kconfig.h>
#include <QTabWidget>
#include <kdebug.h>
#include "kopetechatwindow_debug.h"
#include <KLocalizedString>
#include <kmessagebox.h>
#include <kstringhandler.h>
......@@ -591,7 +591,7 @@ void ChatView::slotContactAdded(const Kopete::Contact *contact, bool suppress)
void ChatView::slotContactRemoved(const Kopete::Contact *contact, const QString &reason, Qt::TextFormat format, bool suppressNotification)
{
// kDebug(14000) ;
// qCDebug(KOPETE_CHATEWINDOW_LOG) ;
if (contact != m_manager->myself()) {
TypingMap::iterator it = m_remoteTypingMap.find(contact);
if (it != m_remoteTypingMap.end()) {
......@@ -637,7 +637,7 @@ QString &ChatView::caption() const
void ChatView::setCaption(const QString &text, bool modified)
{
// kDebug(14000) ;
// qCDebug(KOPETE_CHATEWINDOW_LOG) ;
QString newCaption = text;
//Save this caption
......@@ -716,7 +716,7 @@ void ChatView::slotToggleRtfToolbar(bool enabled)
void ChatView::slotContactStatusChanged(Kopete::Contact *contact, const Kopete::OnlineStatus &newStatus, const Kopete::OnlineStatus &oldStatus)
{
kDebug(14000) << contact;
qCDebug(KOPETE_CHATEWINDOW_LOG) << contact;
bool inhibitNotification = (newStatus.status() == Kopete::OnlineStatus::Unknown
|| oldStatus.status() == Kopete::OnlineStatus::Unknown);
if (contact && Kopete::BehaviorSettings::self()->showEvents() && !inhibitNotification) {
......@@ -842,7 +842,7 @@ void ChatView::readOptions()
{
KConfigGroup kopeteChatWindowMainWinSettings(KSharedConfig::openConfig(), (msgManager()->form() == Kopete::ChatSession::Chatroom ? QStringLiteral("KopeteChatWindowGroupMode") : QStringLiteral(
"KopeteChatWindowIndividualMode")));
//kDebug(14000) << "reading splitterpos from key: " << dockKey;
//qCDebug(KOPETE_CHATEWINDOW_LOG) << "reading splitterpos from key: " << dockKey;
QByteArray state;
state = kopeteChatWindowMainWinSettings.readEntry(QStringLiteral("ChatViewSplitter"), state);
d->splitter->restoreState(QByteArray::fromBase64(state));
......
......@@ -31,7 +31,7 @@
#include <QHideEvent>
#include <QShowEvent>
#include <kdebug.h>
#include "kopetechatwindow_debug.h"
#include <kemoticons.h>
EmoticonItem::EmoticonItem(const QString &emoticonText, const QString &pixmapPath, QListWidget *parent)
......@@ -94,7 +94,7 @@ EmoticonSelector::EmoticonSelector(QWidget *parent)
void EmoticonSelector::prepareList(void)
{
m_emoticonList->clear();
// kDebug(14000) << "called.";
// qCDebug(KOPETE_CHATEWINDOW_LOG) << "called.";
QHash<QString, QStringList> list = Kopete::Emoticons::self()->theme().emoticonsMap();
for (QHash<QString, QStringList>::const_iterator it = list.constBegin(); it != list.constEnd(); ++it) {
......
......@@ -45,7 +45,7 @@
#include <QMenuBar>
#include <kconfig.h>
#include <kiconloader.h>
#include <kdebug.h>
#include "kopetechatwindow_debug.h"
#include <kwindowsystem.h>
#include <ktemporaryfile.h>
#include <kedittoolbar.h>
......
......@@ -26,7 +26,7 @@
#include <QTextStream>
// KDE includes
#include <kdebug.h>
#include "kopetechatwindow_debug.h"
#include <KLocalizedString>
#include <kstandarddirs.h>
#include <QStandardPaths>
......@@ -78,15 +78,15 @@ void ChatWindowStyle::init(const QString &styleName, StyleBuildMode styleBuildMo
QStringList styleDirs = QStandardPaths::locateAll(QStandardPaths::DataLocation, QStringLiteral("/styles/%1/Contents/Resources/").arg(styleName),
QStandardPaths::LocateDirectory);
if (styleDirs.isEmpty()) {
kDebug(14000) << "Failed to find style" << styleName;
qCDebug(KOPETE_CHATEWINDOW_LOG) << "Failed to find style" << styleName;
return;
}
d->styleName = styleName;
if (styleDirs.count() > 1) {
kDebug(14000) << "found several styles with the same name. using first";
qCDebug(KOPETE_CHATEWINDOW_LOG) << "found several styles with the same name. using first";
}
d->baseHref = styleDirs.at(0);
kDebug(14000) << "Using style:" << d->baseHref;
qCDebug(KOPETE_CHATEWINDOW_LOG) << "Using style:" << d->baseHref;
readStyleFiles();
if (styleBuildMode & StyleBuildNormal) {
listVariants();
......@@ -95,7 +95,7 @@ void ChatWindowStyle::init(const QString &styleName, StyleBuildMode styleBuildMo
ChatWindowStyle::~ChatWindowStyle()
{
kDebug(14000);
qCDebug(KOPETE_CHATEWINDOW_LOG);
delete d;
}
......@@ -259,7 +259,7 @@ void ChatWindowStyle::readStyleFiles()
QTextStream headerStream(&fileAccess);
headerStream.setCodec(QTextCodec::codecForName("UTF-8"));
d->headerHtml = headerStream.readAll();
kDebug(14000) << "Header HTML: " << d->headerHtml;
qCDebug(KOPETE_CHATEWINDOW_LOG) << "Header HTML: " << d->headerHtml;
fileAccess.close();
}
// Load Footer file
......@@ -269,7 +269,7 @@ void ChatWindowStyle::readStyleFiles()
QTextStream headerStream(&fileAccess);
headerStream.setCodec(QTextCodec::codecForName("UTF-8"));
d->footerHtml = headerStream.readAll();
kDebug(14000) << "Footer HTML: " << d->footerHtml;
qCDebug(KOPETE_CHATEWINDOW_LOG) << "Footer HTML: " << d->footerHtml;
fileAccess.close();
}
// Load incoming file
......@@ -279,7 +279,7 @@ void ChatWindowStyle::readStyleFiles()
QTextStream headerStream(&fileAccess);
headerStream.setCodec(QTextCodec::codecForName("UTF-8"));
d->incomingHtml = headerStream.readAll();
kDebug(14000) << "Incoming HTML: " << d->incomingHtml;
qCDebug(KOPETE_CHATEWINDOW_LOG) << "Incoming HTML: " << d->incomingHtml;
fileAccess.close();
}
// Load next Incoming file
......@@ -289,7 +289,7 @@ void ChatWindowStyle::readStyleFiles()
QTextStream headerStream(&fileAccess);
headerStream.setCodec(QTextCodec::codecForName("UTF-8"));
d->nextIncomingHtml = headerStream.readAll();
kDebug(14000) << "NextIncoming HTML: " << d->nextIncomingHtml;
qCDebug(KOPETE_CHATEWINDOW_LOG) << "NextIncoming HTML: " << d->nextIncomingHtml;
fileAccess.close();
}
// Load outgoing file
......@@ -299,7 +299,7 @@ void ChatWindowStyle::readStyleFiles()
QTextStream headerStream(&fileAccess);
headerStream.setCodec(QTextCodec::codecForName("UTF-8"));
d->outgoingHtml = headerStream.readAll();
kDebug(14000) << "Outgoing HTML: " << d->outgoingHtml;
qCDebug(KOPETE_CHATEWINDOW_LOG) << "Outgoing HTML: " << d->outgoingHtml;
fileAccess.close();
}
// Load next outgoing file
......@@ -309,7 +309,7 @@ void ChatWindowStyle::readStyleFiles()
QTextStream headerStream(&fileAccess);
headerStream.setCodec(QTextCodec::codecForName("UTF-8"));
d->nextOutgoingHtml = headerStream.readAll();
kDebug(14000) << "NextOutgoing HTML: " << d->nextOutgoingHtml;
qCDebug(KOPETE_CHATEWINDOW_LOG) << "NextOutgoing HTML: " << d->nextOutgoingHtml;
fileAccess.close();
}
// Load status file
......@@ -319,7 +319,7 @@ void ChatWindowStyle::readStyleFiles()
QTextStream headerStream(&fileAccess);
headerStream.setCodec(QTextCodec::codecForName("UTF-8"));
d->statusHtml = headerStream.readAll();
kDebug(14000) << "Status HTML: " << d->statusHtml;
qCDebug(KOPETE_CHATEWINDOW_LOG) << "Status HTML: " << d->statusHtml;
fileAccess.close();
}
......@@ -330,7 +330,7 @@ void ChatWindowStyle::readStyleFiles()
QTextStream headerStream(&fileAccess);
headerStream.setCodec(QTextCodec::codecForName("UTF-8"));
d->actionIncomingHtml = headerStream.readAll();
kDebug(14000) << "ActionIncoming HTML: " << d->actionIncomingHtml;
qCDebug(KOPETE_CHATEWINDOW_LOG) << "ActionIncoming HTML: " << d->actionIncomingHtml;
fileAccess.close();
}
// Load Action Outgoing file
......@@ -340,7 +340,7 @@ void ChatWindowStyle::readStyleFiles()
QTextStream headerStream(&fileAccess);
headerStream.setCodec(QTextCodec::codecForName("UTF-8"));
d->actionOutgoingHtml = headerStream.readAll();
kDebug(14000) << "ActionOutgoing HTML: " << d->actionOutgoingHtml;
qCDebug(KOPETE_CHATEWINDOW_LOG) << "ActionOutgoing HTML: " << d->actionOutgoingHtml;
fileAccess.close();
}
// Load FileTransfer Incoming file
......@@ -350,7 +350,7 @@ void ChatWindowStyle::readStyleFiles()
QTextStream headerStream(&fileAccess);
headerStream.setCodec(QTextCodec::codecForName("UTF-8"));
d->fileTransferIncomingHtml = headerStream.readAll();
kDebug(14000) << "fileTransferIncoming HTML: " << d->fileTransferIncomingHtml;
qCDebug(KOPETE_CHATEWINDOW_LOG) << "fileTransferIncoming HTML: " << d->fileTransferIncomingHtml;
fileAccess.close();
}
......@@ -382,7 +382,7 @@ void ChatWindowStyle::readStyleFiles()
QTextStream headerStream(&fileAccess);
headerStream.setCodec(QTextCodec::codecForName("UTF-8"));
d->voiceClipIncomingHtml = headerStream.readAll();
kDebug(14000) << "voiceClipIncoming HTML: " << d->voiceClipIncomingHtml;
qCDebug(KOPETE_CHATEWINDOW_LOG) << "voiceClipIncoming HTML: " << d->voiceClipIncomingHtml;
fileAccess.close();
}
......@@ -413,7 +413,7 @@ void ChatWindowStyle::readStyleFiles()
QTextStream headerStream(&fileAccess);
headerStream.setCodec(QTextCodec::codecForName("UTF-8"));
d->outgoingStateUnknownHtml = headerStream.readAll();
kDebug(14000) << "Outgoing StateUnknown HTML: " << d->outgoingStateUnknownHtml;
qCDebug(KOPETE_CHATEWINDOW_LOG) << "Outgoing StateUnknown HTML: " << d->outgoingStateUnknownHtml;
fileAccess.close();
}
......@@ -423,7 +423,7 @@ void ChatWindowStyle::readStyleFiles()
QTextStream headerStream(&fileAccess);
headerStream.setCodec(QTextCodec::codecForName("UTF-8"));
d->outgoingStateSendingHtml = headerStream.readAll();
kDebug(14000) << "Outgoing StateSending HTML: " << d->outgoingStateSendingHtml;
qCDebug(KOPETE_CHATEWINDOW_LOG) << "Outgoing StateSending HTML: " << d->outgoingStateSendingHtml;
fileAccess.close();
}
......@@ -433,7 +433,7 @@ void ChatWindowStyle::readStyleFiles()
QTextStream headerStream(&fileAccess);
headerStream.setCodec(QTextCodec::codecForName("UTF-8"));
d->outgoingStateSentHtml = headerStream.readAll();
kDebug(14000) << "Outgoing StateSent HTML: " << d->outgoingStateSentHtml;
qCDebug(KOPETE_CHATEWINDOW_LOG) << "Outgoing StateSent HTML: " << d->outgoingStateSentHtml;
fileAccess.close();
}
......@@ -443,7 +443,7 @@ void ChatWindowStyle::readStyleFiles()
QTextStream headerStream(&fileAccess);
headerStream.setCodec(QTextCodec::codecForName("UTF-8"));
d->outgoingStateErrorHtml = headerStream.readAll();
kDebug(14000) << "Outgoing StateError HTML: " << d->outgoingStateErrorHtml;
qCDebug(KOPETE_CHATEWINDOW_LOG) << "Outgoing StateError HTML: " << d->outgoingStateErrorHtml;
fileAccess.close();
}
}
......
......@@ -25,7 +25,7 @@
// KDE includes
#include <kstandarddirs.h>
#include <kdirlister.h>
#include <kdebug.h>
#include "kopetechatwindow_debug.h"
#include <QUrl>
#include <karchive.h>
......@@ -75,13 +75,13 @@ ChatWindowStyleManager::ChatWindowStyleManager(QObject *parent)
: QObject(parent)
, d(new Private())
{
kDebug(14000);
qCDebug(KOPETE_CHATEWINDOW_LOG);
loadStyles();
}
ChatWindowStyleManager::~ChatWindowStyleManager()
{
kDebug(14000);
qCDebug(KOPETE_CHATEWINDOW_LOG);
delete d;
}
......@@ -254,7 +254,7 @@ int ChatWindowStyleManager::installStyle(const QString &styleBundlePath)
bool ChatWindowStyleManager::removeStyle(const QString &styleName)
{
kDebug(14000) << styleName;
qCDebug(KOPETE_CHATEWINDOW_LOG) << styleName;
// Find for the current style in avaiableStyles map.
int foundStyleIdx = d->availableStyles.indexOf(styleName);
......@@ -270,7 +270,7 @@ bool ChatWindowStyleManager::removeStyle(const QString &styleName)
QStringList styleDirs = QStandardPaths::locateAll(QStandardPaths::DataLocation, QStringLiteral("/styles/%1").arg(styleName), QStandardPaths::LocateDirectory);
if (styleDirs.isEmpty()) {
kDebug(14000) << "Failed to find style" << styleName;
qCDebug(KOPETE_CHATEWINDOW_LOG) << "Failed to find style" << styleName;
return false;
}
......@@ -297,14 +297,14 @@ ChatWindowStyle *ChatWindowStyleManager::getValidStyleFromPool(const QString &st
return style;
}
kDebug(14000) << "Trying default style";
qCDebug(KOPETE_CHATEWINDOW_LOG) << "Trying default style";
// Try default style
style = getStyleFromPool(QStringLiteral("Kopete"));
if (style) {
return style;
}
kDebug(14000) << "Trying first valid style";
qCDebug(KOPETE_CHATEWINDOW_LOG) << "Trying first valid style";
// Try first valid style
foreach (const QString &name, d->availableStyles) {
style = getStyleFromPool(name);
......@@ -313,14 +313,14 @@ ChatWindowStyle *ChatWindowStyleManager::getValidStyleFromPool(const QString &st
}
}
kDebug(14000) << "Valid style not found!";
qCDebug(KOPETE_CHATEWINDOW_LOG) << "Valid style not found!";
return 0;
}
ChatWindowStyle *ChatWindowStyleManager::getStyleFromPool(const QString &styleName)
{
if (d->stylePool.contains(styleName)) {
kDebug(14000) << styleName << " was on the pool";
qCDebug(KOPETE_CHATEWINDOW_LOG) << styleName << " was on the pool";
// NOTE: This is a hidden config switch for style developers
// Check in the config if the cache is disabled.
......@@ -337,13 +337,13 @@ ChatWindowStyle *ChatWindowStyleManager::getStyleFromPool(const QString &styleNa
// Build a chat window style and list its variants, then add it to the pool.
ChatWindowStyle *style = new ChatWindowStyle(styleName, ChatWindowStyle::StyleBuildNormal);
if (!style->isValid()) {
kDebug(14000) << styleName << " is invalid style!";
qCDebug(KOPETE_CHATEWINDOW_LOG) << styleName << " is invalid style!";
delete style;
return 0;
}
d->stylePool.insert(styleName, style);
kDebug(14000) << styleName << " is just created";
qCDebug(KOPETE_CHATEWINDOW_LOG) << styleName << " is just created";
return style;
}
......@@ -353,12 +353,12 @@ void ChatWindowStyleManager::slotNewStyles(const KFileItemList &dirList)
foreach (const KFileItem &item, dirList) {
// Ignore data dir(from deprecated XSLT themes)
if (!item.url().fileName().contains(QLatin1String("data"))) {
kDebug(14000) << "Listing: " << item.url().fileName();
qCDebug(KOPETE_CHATEWINDOW_LOG) << "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 styleName = item.url().fileName();
if (d->stylePool.contains(styleName)) {
kDebug(14000) << "Updating style: " << styleName;
qCDebug(KOPETE_CHATEWINDOW_LOG) << "Updating style: " << styleName;
d->stylePool[styleName]->reload();
......@@ -378,7 +378,7 @@ void ChatWindowStyleManager::slotDirectoryFinished()
{
// Start another scanning if the directories stack is not empty
if (!d->styleDirs.isEmpty()) {
kDebug(14000) << "Starting another directory.";
qCDebug(KOPETE_CHATEWINDOW_LOG) << "Starting another directory.";
d->styleDirLister->openUrl(d->styleDirs.pop(), KDirLister::Keep);
} else {
emit loadStylesFinished();
......
......@@ -35,7 +35,7 @@
#include <QColorDialog>
#include <kconfig.h>
#include <kcursor.h>
#include <kdebug.h>
#include "kopetechatwindow_debug.h"
#include <KConfigGroup>
#include <kedittoolbar.h>
......
......@@ -26,7 +26,7 @@
#include <QMenu>
#include <QAction>
#include <kdebug.h>
#include "kopetechatwindow_debug.h"
#include <KLocalizedString>
#include <QMenuBar>
#include <ktoolbar.h>
......
......@@ -23,7 +23,7 @@
#include "kopeterichtextwidget.h"
// KDE includes
#include <kdebug.h>
#include "kopetechatwindow_debug.h"
#include <kactioncollection.h>
#include <kactionmenu.h>
#include <klocalizedstring.h>
......@@ -547,8 +547,8 @@ bool KopeteRichTextWidget::isRichTextEnabled() const
void KopeteRichTextWidget::slotTextModeChanged(KRichTextEdit::Mode)
{
if (d->changingTextMode == false) {
kWarning() << "Unexpected text mode change!!!";
kWarning() << kBacktrace();
qCWarning(KOPETE_CHATEWINDOW_LOG) << "Unexpected text mode change!!!";
//kWarning() << kBacktrace();
}
}
......
......@@ -28,7 +28,7 @@
// KDE includes
#include <kunittest/module.h>
#include <kcomponentdata.h>
#include <kdebug.h>
#include "kopetechatwindow_debug.h"
#include <kglobal.h>
#include <klocale.h>
......@@ -216,7 +216,7 @@ void ChatWindowStyleRendering_Test::testHeaderRendering()
resultHtml = chatPart->formatStyleKeywords(headerHtml);
kDebug(14000) << "Result HTML: " << resultHtml;
qCDebug(KOPETE_CHATEWINDOW_LOG) << "Result HTML: " << resultHtml;
CHECK(resultHtml, expectedHtml);
}
......@@ -258,14 +258,14 @@ void ChatWindowStyleRendering_Test::testMessageRendering()
tempHtml = d->testStyle->getIncomingHtml();
resultHtml = chatPart->formatStyleKeywords(tempHtml, msgIn);
kDebug(14000) << "Message incoming HTML: " << resultHtml;
qCDebug(KOPETE_CHATEWINDOW_LOG) << "Message incoming HTML: " << resultHtml;
CHECK(resultHtml, expectedIncomingHtml);
tempHtml = d->testStyle->getOutgoingHtml();
resultHtml = chatPart->formatStyleKeywords(tempHtml, msgOut);
kDebug(14000) << "Message outgoing HTML: " << resultHtml;
qCDebug(KOPETE_CHATEWINDOW_LOG) << "Message outgoing HTML: " << resultHtml;
CHECK(resultHtml, expectedOutgoingHtml);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment