[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=ecdcf8e
The following commit has been merged in the master branch:
commit ecdcf8e0096c8b9cde5049092bf911c2fcab7dda
Author: Aleix Pol <aleixpol at kde.org>
Date: Mon Dec 15 15:37:12 2014 +0100
Drop KDELibs4Support from KTp-common-internals libraries
They were just using KDebug so far
---
KTp/CMakeLists.txt | 4 +++-
KTp/abstract-message-filter.cpp | 4 ++--
KTp/actions.cpp | 44 +++++++++++++++++------------------
KTp/debug.cpp | 11 +++++----
KTp/error-dictionary.cpp | 5 ++--
KTp/global-contact-manager.cpp | 6 ++---
KTp/global-presence.cpp | 20 ++++++++--------
KTp/{Models/debug.h => ktp-debug.h} | 2 +-
KTp/logs-importer-private.cpp | 31 ++++++++++++------------
KTp/logs-importer-private.h | 3 +--
KTp/message-escape-filter.cpp | 5 ++--
KTp/message-filter-config-manager.cpp | 2 +-
KTp/message-processor.cpp | 20 ++++++++--------
KTp/message.cpp | 6 ++---
KTp/outgoing-message.cpp | 2 +-
KTp/persistent-contact.cpp | 4 ++--
KTp/service-availability-checker.cpp | 4 ++--
KTp/telepathy-handler-application.cpp | 11 +++------
KTp/wallet-interface.cpp | 14 +++++------
19 files changed, 96 insertions(+), 102 deletions(-)
diff --git a/KTp/CMakeLists.txt b/KTp/CMakeLists.txt
index d5ca6bd..b4a8bf3 100644
--- a/KTp/CMakeLists.txt
+++ b/KTp/CMakeLists.txt
@@ -96,7 +96,9 @@ target_link_libraries (KTpCommonInternals
PRIVATE
${ktp_private_LIBS}
KF5::KIOWidgets
- KF5::KDELibs4Support
+ KF5::I18n
+ KF5::IconThemes
+ KF5::Notifications
)
target_include_directories(KTpCommonInternals PUBLIC ${TELEPATHY_QT5_INCLUDE_DIR}) # TODO: Remove when TelepathyQt exports include paths properly
diff --git a/KTp/abstract-message-filter.cpp b/KTp/abstract-message-filter.cpp
index 29323bb..f592840 100644
--- a/KTp/abstract-message-filter.cpp
+++ b/KTp/abstract-message-filter.cpp
@@ -17,7 +17,7 @@
*/
#include "abstract-message-filter.h"
-#include <KDebug>
+#include "ktp-debug.h"
namespace KTp {
@@ -51,7 +51,7 @@ void AbstractMessageFilter::filterOutgoingMessage(KTp::OutgoingMessage &message,
Q_UNUSED(message)
Q_UNUSED(context)
- kDebug() << metaObject()->className() << " has no outgoing component";
+ qCDebug(KTP_COMMONINTERNALS) << metaObject()->className() << " has no outgoing component";
}
}
diff --git a/KTp/actions.cpp b/KTp/actions.cpp
index efb6647..17d631f 100644
--- a/KTp/actions.cpp
+++ b/KTp/actions.cpp
@@ -27,7 +27,7 @@
#include <QMimeType>
#include <KToolInvocation>
-#include <KDebug>
+#include "ktp-debug.h"
#include <KLocalizedString>
#include <KNotification>
#include <KAboutData>
@@ -44,10 +44,10 @@ Tp::PendingChannelRequest* Actions::startChat(const Tp::AccountPtr &account,
bool delegateToPreferredHandler)
{
if (account.isNull() || contactIdentifier.isEmpty()) {
- kWarning() << "Parameters invalid";
+ qCWarning(KTP_COMMONINTERNALS) << "Parameters invalid";
}
- kDebug() << "Requesting text channel for contact id: " << contactIdentifier;
+ qCDebug(KTP_COMMONINTERNALS) << "Requesting text channel for contact id: " << contactIdentifier;
Tp::ChannelRequestHints hints;
if (delegateToPreferredHandler) {
@@ -67,10 +67,10 @@ Tp::PendingChannelRequest* Actions::startChat(const Tp::AccountPtr &account,
bool delegateToPreferredHandler)
{
if (account.isNull() || contact.isNull()) {
- kWarning() << "Parameters invalid";
+ qCWarning(KTP_COMMONINTERNALS) << "Parameters invalid";
}
- kDebug() << "Requesting text channel for" << contact->id();
+ qCDebug(KTP_COMMONINTERNALS) << "Requesting text channel for" << contact->id();
Tp::ChannelRequestHints hints;
if (delegateToPreferredHandler) {
@@ -89,10 +89,10 @@ Tp::PendingChannelRequest* Actions::startGroupChat(const Tp::AccountPtr &account
const QString &roomName)
{
if (account.isNull() || roomName.isEmpty()) {
- kWarning() << "Parameters invalid";
+ qCWarning(KTP_COMMONINTERNALS) << "Parameters invalid";
}
- kDebug() << "Requesting text chat room " << roomName;
+ qCDebug(KTP_COMMONINTERNALS) << "Requesting text chat room " << roomName;
Tp::ChannelRequestHints hints;
hints.setHint(QLatin1String("org.kde.telepathy"), QLatin1String("forceRaiseWindow"), QVariant(true));
@@ -107,10 +107,10 @@ Tp::PendingChannelRequest* Actions::startAudioCall(const Tp::AccountPtr &account
const Tp::ContactPtr &contact)
{
if (account.isNull() || contact.isNull()) {
- kWarning() << "Parameters invalid";
+ qCWarning(KTP_COMMONINTERNALS) << "Parameters invalid";
}
- kDebug() << "Requesting audio channel for" << contact->id();
+ qCDebug(KTP_COMMONINTERNALS) << "Requesting audio channel for" << contact->id();
return account->ensureAudioCall(contact,
QLatin1String("audio"),
@@ -122,10 +122,10 @@ Tp::PendingChannelRequest* Actions::startAudioVideoCall(const Tp::AccountPtr &ac
const Tp::ContactPtr &contact)
{
if (account.isNull() || contact.isNull()) {
- kWarning() << "Parameters invalid";
+ qCWarning(KTP_COMMONINTERNALS) << "Parameters invalid";
}
- kDebug() << "Requesting audio-video channel for" << contact->id();
+ qCDebug(KTP_COMMONINTERNALS) << "Requesting audio-video channel for" << contact->id();
return account->ensureAudioVideoCall(contact,
QLatin1String("audio"),
@@ -138,10 +138,10 @@ Tp::PendingChannelRequest* Actions::startDesktopSharing(const Tp::AccountPtr &ac
const Tp::ContactPtr &contact)
{
if (account.isNull() || contact.isNull()) {
- kWarning() << "Parameters invalid";
+ qCWarning(KTP_COMMONINTERNALS) << "Parameters invalid";
}
- kDebug() << "Requesting stream tube for" << contact->id();
+ qCDebug(KTP_COMMONINTERNALS) << "Requesting stream tube for" << contact->id();
return account->createStreamTube(contact,
QLatin1String("rfb"),
@@ -154,10 +154,10 @@ Tp::PendingChannelRequest* Actions::startFileTransfer(const Tp::AccountPtr &acco
const QString &filePath)
{
if (account.isNull() || contact.isNull()) {
- kWarning() << "Parameters invalid";
+ qCWarning(KTP_COMMONINTERNALS) << "Parameters invalid";
}
- kDebug() << "Requesting file transfer of" << filePath << "to" << contact->id();
+ qCDebug(KTP_COMMONINTERNALS) << "Requesting file transfer of" << filePath << "to" << contact->id();
QFileInfo fileInfo(filePath);
@@ -166,7 +166,7 @@ Tp::PendingChannelRequest* Actions::startFileTransfer(const Tp::AccountPtr &acco
if (account->serviceName() == QLatin1String("google-talk") &&
(fileInfo.suffix() == QLatin1String("exe") || fileInfo.suffix() == QLatin1String("ini"))) {
- kDebug() << "Google Talk forbids transfering files with suffix \"ini\" or \"exe\". Renaming.";
+ qCDebug(KTP_COMMONINTERNALS) << "Google Talk forbids transfering files with suffix \"ini\" or \"exe\". Renaming.";
QString fileName = fileInfo.fileName().append(QLatin1String("_"));
@@ -202,10 +202,10 @@ Tp::PendingOperation* Actions::startFileTransfer(const Tp::AccountPtr &account,
const QUrl &url)
{
if (account.isNull() || contact.isNull() || url.isEmpty()) {
- kWarning() << "Parameters invalid";
+ qCWarning(KTP_COMMONINTERNALS) << "Parameters invalid";
}
- kDebug() << "Requesting file transfer of" << url.toLocalFile() << "to" << contact->id();
+ qCDebug(KTP_COMMONINTERNALS) << "Requesting file transfer of" << url.toLocalFile() << "to" << contact->id();
Tp::PendingOperation *ret = 0;
if (url.isLocalFile()) {
@@ -220,7 +220,7 @@ void Actions::openLogViewer(const Tp::AccountPtr &account,
const Tp::ContactPtr &contact)
{
if (account.isNull() || contact.isNull()) {
- kWarning() << "Parameters invalid";
+ qCWarning(KTP_COMMONINTERNALS) << "Parameters invalid";
return;
}
@@ -229,7 +229,7 @@ void Actions::openLogViewer(const Tp::AccountPtr &account,
void Actions::openLogViewer(const QUrl &uri)
{
- kDebug() << "Opening logviewer for" << uri;
+ qCDebug(KTP_COMMONINTERNALS) << "Opening logviewer for" << uri;
QStringList arguments;
arguments << QLatin1String("--") << uri.toString();
@@ -240,11 +240,11 @@ void Actions::openLogViewer(const QUrl &uri)
void Actions::openLogViewer(const Tp::AccountPtr& account, const QString& targetId)
{
if (account.isNull() || targetId.isEmpty()) {
- kWarning() << " Parameters invalid";
+ qCWarning(KTP_COMMONINTERNALS) << " Parameters invalid";
return;
}
- kDebug() << "Opening logviewer for" << targetId;
+ qCDebug(KTP_COMMONINTERNALS) << "Opening logviewer for" << targetId;
QStringList arguments;
arguments << QLatin1String("--") << account->uniqueIdentifier() << targetId;
diff --git a/KTp/debug.cpp b/KTp/debug.cpp
index dce79f3..3f6925c 100644
--- a/KTp/debug.cpp
+++ b/KTp/debug.cpp
@@ -18,15 +18,15 @@
#include "debug.h"
-#include <KDebug>
#include <TelepathyQt/Debug>
+#include <QLoggingCategory>
+Q_DECLARE_LOGGING_CATEGORY(TELEPATHY_QT)
namespace KTp
{
namespace {
-int s_tpqtDebugArea;
QString libraryString;
static void tpDebugCallback(const QString &libraryName,
@@ -37,15 +37,13 @@ static void tpDebugCallback(const QString &libraryName,
if (Q_UNLIKELY(libraryString.isEmpty())) {
libraryString = QString::fromLatin1("%1:%2()").arg(libraryName, libraryVersion);
}
- kDebugStream(type, s_tpqtDebugArea, __FILE__, __LINE__, libraryString.toLatin1()) << qPrintable(msg);
+ qCDebug(TELEPATHY_QT) << libraryString << qPrintable(msg);
}
} // namespace
} // namespace KTp
void KTp::Debug::installCallback(bool debug, bool warning)
{
- s_tpqtDebugArea = KDebug::registerArea("Telepathy-Qt");
-
// Redirect Tp debug and warnings to KDebug output
Tp::setDebugCallback(&tpDebugCallback);
@@ -53,3 +51,6 @@ void KTp::Debug::installCallback(bool debug, bool warning)
Tp::enableDebug(debug);
Tp::enableWarnings(warning);
}
+
+Q_LOGGING_CATEGORY(KTP_COMMONINTERNALS, "ktp-logger")
+Q_LOGGING_CATEGORY(TELEPATHY_QT, "ktp-logger")
diff --git a/KTp/error-dictionary.cpp b/KTp/error-dictionary.cpp
index 7785bd1..b006a6b 100644
--- a/KTp/error-dictionary.cpp
+++ b/KTp/error-dictionary.cpp
@@ -24,8 +24,7 @@
#include <TelepathyQt/Constants>
#include <KLocalizedString>
-#include <KLocale>
-#include <KDebug>
+#include "ktp-debug.h"
namespace KTp
{
@@ -241,7 +240,7 @@ QString ErrorDictionary::displayShortErrorMessage(const QString& dbusErrorName)
return i18nc("Short user visible error string", "Internal component error");
} else {
//print the error so users can send it in
- kWarning() << "Unknown error encountered:" << dbusErrorName;
+ qCWarning(KTP_COMMONINTERNALS) << "Unknown error encountered:" << dbusErrorName;
return i18nc("User visible error string", "Unknown error");
}
}
diff --git a/KTp/global-contact-manager.cpp b/KTp/global-contact-manager.cpp
index 80285dc..a3c955b 100644
--- a/KTp/global-contact-manager.cpp
+++ b/KTp/global-contact-manager.cpp
@@ -27,7 +27,7 @@
#include "KTp/types.h"
-#include <KDebug>
+#include "ktp-debug.h"
namespace KTp {
@@ -70,7 +70,7 @@ Tp::Contacts GlobalContactManager::allKnownContacts() const
void GlobalContactManager::onAccountManagerReady(Tp::PendingOperation *op)
{
if (op->isError()) {
- kWarning() << "Account Manager becomeReady failed";
+ qCWarning(KTP_COMMONINTERNALS) << "Account Manager becomeReady failed";
}
Q_FOREACH(const Tp::AccountPtr &account, d->accountManager->allAccounts()) {
@@ -143,7 +143,7 @@ void GlobalContactManager::onContactManagerStateChanged(const Tp::ContactManager
Tp::AccountPtr GlobalContactManager::accountForContact(const Tp::ContactPtr &contact) const
{
if (!contact || !contact->manager()) {
- kWarning() << "Null contact or contact manager!";
+ qCWarning(KTP_COMMONINTERNALS) << "Null contact or contact manager!";
return Tp::AccountPtr();
}
return accountForConnection(contact->manager()->connection());
diff --git a/KTp/global-presence.cpp b/KTp/global-presence.cpp
index 08e268b..4f4b764 100644
--- a/KTp/global-presence.cpp
+++ b/KTp/global-presence.cpp
@@ -26,7 +26,7 @@
#include <TelepathyQt/Account>
#include <TelepathyQt/PendingReady>
-#include <KDebug>
+#include "ktp-debug.h"
namespace KTp
{
@@ -46,7 +46,7 @@ GlobalPresence::GlobalPresence(QObject *parent)
void GlobalPresence::setAccountManager(const Tp::AccountManagerPtr &accountManager)
{
if (! accountManager->isReady()) {
- kWarning() << "GlobalPresence used with unready account manager";
+ qCWarning(KTP_COMMONINTERNALS) << "GlobalPresence used with unready account manager";
}
m_enabledAccounts = accountManager->enabledAccounts();
@@ -79,11 +79,11 @@ Tp::AccountManagerPtr GlobalPresence::accountManager() const
void GlobalPresence::onAccountManagerReady(Tp::PendingOperation* op)
{
if (op->isError()) {
- kDebug() << op->errorName();
- kDebug() << op->errorMessage();
+ qCDebug(KTP_COMMONINTERNALS) << op->errorName();
+ qCDebug(KTP_COMMONINTERNALS) << op->errorMessage();
//TODO: Create signal to send to client
- kDebug() << "Something unexpected happened to the core part of your Instant Messaging system "
+ qCDebug(KTP_COMMONINTERNALS) << "Something unexpected happened to the core part of your Instant Messaging system "
<< "and it couldn't be initialized. Try restarting the client.";
return;
@@ -153,7 +153,7 @@ bool GlobalPresence::isChangingPresence() const
void GlobalPresence::setPresence(const KTp::Presence &presence)
{
if (m_enabledAccounts.isNull()) {
- kWarning() << "Requested presence change on empty accounts set";
+ qCWarning(KTP_COMMONINTERNALS) << "Requested presence change on empty accounts set";
return;
}
@@ -184,7 +184,7 @@ void GlobalPresence::setPresence(GlobalPresence::ConnectionPresenceType p, QStri
setPresence(Tp::Presence::offline(message));
break;
default:
- kDebug() << "You should not be here!";
+ qCDebug(KTP_COMMONINTERNALS) << "You should not be here!";
}
}
@@ -232,7 +232,7 @@ void GlobalPresence::onCurrentPresenceChanged()
}
}
- kDebug() << "Current presence changed";
+ qCDebug(KTP_COMMONINTERNALS) << "Current presence changed";
if (highestCurrentPresence.type() != m_currentPresence.type() ||
highestCurrentPresence.status() != m_currentPresence.status() ||
@@ -316,13 +316,13 @@ bool GlobalPresence::hasEnabledAccounts() const
void GlobalPresence::saveCurrentPresence()
{
- kDebug() << "Saving presence with message:" << m_currentPresence.statusMessage();
+ qCDebug(KTP_COMMONINTERNALS) << "Saving presence with message:" << m_currentPresence.statusMessage();
m_savedPresence = m_currentPresence;
}
void GlobalPresence::restoreSavedPresence()
{
- kDebug() << m_savedPresence.statusMessage();
+ qCDebug(KTP_COMMONINTERNALS) << m_savedPresence.statusMessage();
setPresence(m_savedPresence);
}
diff --git a/KTp/Models/debug.h b/KTp/ktp-debug.h
similarity index 95%
copy from KTp/Models/debug.h
copy to KTp/ktp-debug.h
index fd4b67a..dc3bec3 100644
--- a/KTp/Models/debug.h
+++ b/KTp/ktp-debug.h
@@ -24,6 +24,6 @@
// 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_MODELS)
+Q_DECLARE_LOGGING_CATEGORY(KTP_COMMONINTERNALS)
#endif
diff --git a/KTp/logs-importer-private.cpp b/KTp/logs-importer-private.cpp
index 1f222c0..a655dc0 100644
--- a/KTp/logs-importer-private.cpp
+++ b/KTp/logs-importer-private.cpp
@@ -20,8 +20,7 @@
#include "logs-importer.h"
#include <KLocalizedString>
-#include <KDebug>
-#include <KTimeZone>
+#include "ktp-debug.h"
#include <QStandardPaths>
using namespace KTp;
@@ -113,7 +112,7 @@ QString LogsImporter::Private::accountIdToProtocol(const QString &accountId) con
* Skype - not supported by KTp
* WinPopup - no support in Telepathy
*/
- kWarning() << accountId << "is an unsupported protocol";
+ qCWarning(KTP_COMMONINTERNALS) << accountId << "is an unsupported protocol";
return QString();
}
}
@@ -124,13 +123,13 @@ QStringList LogsImporter::Private::findKopeteLogs(const QString &accountId) cons
QString protocol = accountIdToProtocol(accountId);
if (protocol.isEmpty()) {
- kWarning() << "Unsupported protocol";
+ qCWarning(KTP_COMMONINTERNALS) << "Unsupported protocol";
return files;
}
QString kopeteAccountId = accountIdToAccountName(accountId);
if (kopeteAccountId.isEmpty()) {
- kWarning() << "Unable to parse account ID";
+ qCWarning(KTP_COMMONINTERNALS) << "Unable to parse account ID";
return files;
}
@@ -199,21 +198,21 @@ void LogsImporter::Private::saveKTpDocument()
QTextStream stream(&outFile);
m_ktpDocument.save(stream, 0);
- kDebug() << "Stored as" << path;
+ qCDebug(KTP_COMMONINTERNALS) << "Stored as" << path;
}
-KDateTime LogsImporter::Private::parseKopeteTime(const QDomElement& kopeteMessage) const
+QDateTime LogsImporter::Private::parseKopeteTime(const QDomElement& kopeteMessage) const
{
QString strtime = kopeteMessage.attribute(QLatin1String("time"));
if (strtime.isEmpty()) {
- return KDateTime();
+ return QDateTime();
}
/* Kopete time attribute is in format "D H:M:S" - year and month are stored in
* log header, Hour, minute and seconds don't have zero padding */
QStringList dateTime = strtime.split(QLatin1Char(' '), QString::SkipEmptyParts);
if (dateTime.length() != 2) {
- return KDateTime();
+ return QDateTime();
}
QStringList time = dateTime.at(1).split(QLatin1Char(':'));
@@ -229,17 +228,17 @@ KDateTime LogsImporter::Private::parseKopeteTime(const QDomElement& kopeteMessag
/* Kopete stores date in local timezone but Telepathy in UTC. Note that we
* must use time offset at the specific date rather then current offset
* (could be different due to for example DST) */
- KDateTime localTz = KDateTime::fromString(str, KDateTime::ISODate);
- KDateTime utc = localTz.addSecs(-KDateTime::currentLocalDateTime().timeZone().offset(localTz.toTime_t()));
+ QDateTime localTz = QDateTime::fromString(str, Qt::ISODate);
+ QDateTime utc = localTz.addSecs(-QDateTime::currentDateTime().timeZone().offsetData(localTz).offsetFromUtc);
return utc;
}
QDomElement LogsImporter::Private::convertKopeteMessage(const QDomElement& kopeteMessage)
{
- KDateTime time = parseKopeteTime(kopeteMessage);
+ QDateTime time = parseKopeteTime(kopeteMessage);
if (!time.isValid()) {
- kWarning() << "Failed to parse message time, skipping message";
+ qCWarning(KTP_COMMONINTERNALS) << "Failed to parse message time, skipping message";
return QDomElement();
}
@@ -259,7 +258,7 @@ QDomElement LogsImporter::Private::convertKopeteMessage(const QDomElement& kopet
}
QDomElement ktpMessage = m_ktpDocument.createElement(QLatin1String("message"));
- ktpMessage.setAttribute(QLatin1String("time"), time.toUtc().toString(QLatin1String("%Y%m%dT%H:%M:%S")));
+ ktpMessage.setAttribute(QStringLiteral("time"), time.toUTC().toString(QStringLiteral("%Y%m%dT%H:%M:%S")));
QString sender = kopeteMessage.attribute(QLatin1String("from"));
if (!m_isMUCLog && sender.startsWith(m_contactId) && sender.length() > m_contactId.length()) {
@@ -295,7 +294,7 @@ QDomElement LogsImporter::Private::convertKopeteMessage(const QDomElement& kopet
void LogsImporter::Private::convertKopeteLog(const QString& filepath)
{
- kDebug() << "Converting" << filepath;
+ qCDebug(KTP_COMMONINTERNALS) << "Converting" << filepath;
/* Init */
m_day = 0;
@@ -357,7 +356,7 @@ void LogsImporter::Private::convertKopeteLog(const QString& filepath)
}
if ((m_year == 0) || (m_month == 0) || m_meId.isEmpty() || m_contactId.isEmpty()) {
- kWarning() << "Failed to correctly parse header. Possibly invalid log format";
+ qCWarning(KTP_COMMONINTERNALS) << "Failed to correctly parse header. Possibly invalid log format";
return;
}
diff --git a/KTp/logs-importer-private.h b/KTp/logs-importer-private.h
index 06c9c0d..a74c9b8 100644
--- a/KTp/logs-importer-private.h
+++ b/KTp/logs-importer-private.h
@@ -22,7 +22,6 @@
#include <QThread>
#include <QStringList>
#include <QDomDocument>
-#include <KDateTime>
#include "logs-importer.h"
@@ -52,7 +51,7 @@ class LogsImporter::Private: public QThread
void initKTpDocument();
void saveKTpDocument();
- KDateTime parseKopeteTime(const QDomElement &kopeteMessage) const;
+ QDateTime parseKopeteTime(const QDomElement &kopeteMessage) const;
QDomElement convertKopeteMessage(const QDomElement &kopeteMessage);
void convertKopeteLog(const QString &filepath);
diff --git a/KTp/message-escape-filter.cpp b/KTp/message-escape-filter.cpp
index d22a7ff..ba7a30a 100644
--- a/KTp/message-escape-filter.cpp
+++ b/KTp/message-escape-filter.cpp
@@ -21,7 +21,6 @@
#include <QTextDocument> //needed for Qt::escape
#include <KTp/text-parser.h>
-#include <KUrl>
MessageEscapeFilter::MessageEscapeFilter(QObject *parent)
: KTp::AbstractMessageFilter(parent)
@@ -53,8 +52,8 @@ void MessageEscapeFilter::filterMessage(KTp::Message &message, const KTp::Messag
int offset = 0;
for (int i = 0; i < parsedUrl.fixedUrls.size(); i++) {
- KUrl url(parsedUrl.fixedUrls.at(i));
- if (url.protocol() != QLatin1String("mailto")) {
+ QUrl url(parsedUrl.fixedUrls.at(i));
+ if (url.scheme() != QLatin1String("mailto")) {
QString originalText = messageText.mid(parsedUrl.urlRanges.at(i).first + offset, parsedUrl.urlRanges.at(i).second);
QString link = QString::fromLatin1("<a href=\"%1\">%2</a>").arg(QString::fromAscii(url.toEncoded()), originalText);
diff --git a/KTp/message-filter-config-manager.cpp b/KTp/message-filter-config-manager.cpp
index bca93e0..4202779 100644
--- a/KTp/message-filter-config-manager.cpp
+++ b/KTp/message-filter-config-manager.cpp
@@ -22,7 +22,7 @@
#include <QMutex>
#include <QSet>
-#include <KDebug>
+#include "ktp-debug.h"
#include <KServiceTypeTrader>
typedef QSet<KPluginInfo> PluginSet;
diff --git a/KTp/message-processor.cpp b/KTp/message-processor.cpp
index 517d54d..a7ff829 100644
--- a/KTp/message-processor.cpp
+++ b/KTp/message-processor.cpp
@@ -25,7 +25,7 @@
#include <QMutex>
#include <QStringBuilder>
-#include <KDebug>
+#include "ktp-debug.h"
#include <KService>
#include <KServiceTypeTrader>
#include <KPluginFactory>
@@ -68,15 +68,15 @@ void MessageProcessor::Private::loadFilter(const KPluginInfo &pluginInfo)
KPluginFactory *factory = KPluginLoader(service->library()).factory();
if (factory) {
- kDebug() << "loaded factory :" << factory;
+ qCDebug(KTP_COMMONINTERNALS) << "loaded factory :" << factory;
AbstractMessageFilter *filter = factory->create<AbstractMessageFilter>(q);
if (filter) {
- kDebug() << "loaded message filter : " << filter;
+ qCDebug(KTP_COMMONINTERNALS) << "loaded message filter : " << filter;
filters << FilterPlugin(pluginInfo, filter);
}
} else {
- kError() << "error loading plugin :" << service->library();
+ qCWarning(KTP_COMMONINTERNALS) << "error loading plugin :" << service->library();
}
// Re-sort filters by weight
@@ -90,7 +90,7 @@ void MessageProcessor::Private::unloadFilter(const KPluginInfo &pluginInfo)
const FilterPlugin &plugin = *iter;
if (plugin.name == pluginInfo.pluginName()) {
- kDebug() << "unloading message filter : " << plugin.instance;
+ qCDebug(KTP_COMMONINTERNALS) << "unloading message filter : " << plugin.instance;
plugin.instance->deleteLater();
filters.erase(iter);
return;
@@ -100,7 +100,7 @@ void MessageProcessor::Private::unloadFilter(const KPluginInfo &pluginInfo)
void MessageProcessor::Private::loadFilters()
{
- kDebug() << "Starting loading filters...";
+ qCDebug(KTP_COMMONINTERNALS) << "Starting loading filters...";
KPluginInfo::List plugins = MessageFilterConfigManager::self()->enabledPlugins();
@@ -111,7 +111,7 @@ void MessageProcessor::Private::loadFilters()
KTp::MessageProcessor* MessageProcessor::instance()
{
- kDebug();
+ qCDebug(KTP_COMMONINTERNALS);
static KTp::MessageProcessor *mp_instance;
static QMutex mutex;
@@ -174,7 +174,7 @@ QString MessageProcessor::header()
% QLatin1String("\" />
");
}
- kDebug() << out;
+ qCDebug(KTP_COMMONINTERNALS) << out;
return out;
}
@@ -194,7 +194,7 @@ KTp::Message KTp::MessageProcessor::processIncomingMessage(const Tp::ReceivedMes
KTp::Message MessageProcessor::processIncomingMessage(KTp::Message message, const KTp::MessageContext &context)
{
Q_FOREACH (const FilterPlugin &plugin, d->filters) {
- kDebug() << "running filter :" << plugin.instance->metaObject()->className();
+ qCDebug(KTP_COMMONINTERNALS) << "running filter :" << plugin.instance->metaObject()->className();
plugin.instance->filterMessage(message, context);
}
return message;
@@ -206,7 +206,7 @@ KTp::OutgoingMessage MessageProcessor::processOutgoingMessage(const QString &mes
KTp::OutgoingMessage message(messageText);
Q_FOREACH (const FilterPlugin &plugin, d->filters) {
- kDebug() << "running outgoing filter : " << plugin.instance->metaObject()->className();
+ qCDebug(KTP_COMMONINTERNALS) << "running outgoing filter : " << plugin.instance->metaObject()->className();
plugin.instance->filterOutgoingMessage(message, context);
}
diff --git a/KTp/message.cpp b/KTp/message.cpp
index 76a54f9..2a2640a 100644
--- a/KTp/message.cpp
+++ b/KTp/message.cpp
@@ -20,7 +20,7 @@
#include "message.h"
#include "message-private.h"
-#include <KDebug>
+#include "ktp-debug.h"
#include <QSharedData>
#include <TelepathyQt/ContactManager>
@@ -120,7 +120,7 @@ QString Message::finalizedMessage() const
QString msg = d->mainPart + QLatin1String("
") +
d->parts.join(QLatin1String("
"));
-// kDebug() << msg;
+// qCDebug(KTP_COMMONINTERNALS) << msg;
return msg;
}
@@ -136,7 +136,7 @@ QString Message::finalizedScript() const
finalScript.append(QLatin1String("false;"));
}
-// kDebug() << finalScript;
+// qCDebug(KTP_COMMONINTERNALS) << finalScript;
return finalScript;
}
diff --git a/KTp/outgoing-message.cpp b/KTp/outgoing-message.cpp
index 0dcb106..512a482 100644
--- a/KTp/outgoing-message.cpp
+++ b/KTp/outgoing-message.cpp
@@ -19,7 +19,7 @@
#include "outgoing-message.h"
-#include <KDebug>
+#include "ktp-debug.h"
#include <QSharedData>
#include <TelepathyQt/ContactManager>
diff --git a/KTp/persistent-contact.cpp b/KTp/persistent-contact.cpp
index c7885d3..866110a 100644
--- a/KTp/persistent-contact.cpp
+++ b/KTp/persistent-contact.cpp
@@ -27,7 +27,7 @@
#include <KTp/core.h>
-#include <KDebug>
+#include "ktp-debug.h"
namespace KTp
{
@@ -92,7 +92,7 @@ Tp::AccountPtr KTp::PersistentContact::account() const
void KTp::PersistentContact::onAccountReady(Tp::PendingOperation *op)
{
if (op->isError()) {
- kWarning() << "could not load account " << d->accountId;
+ qCWarning(KTP_COMMONINTERNALS) << "could not load account " << d->accountId;
}
Tp::PendingReady *pendingReady = qobject_cast<Tp::PendingReady*>(op);
Q_ASSERT(pendingReady);
diff --git a/KTp/service-availability-checker.cpp b/KTp/service-availability-checker.cpp
index e1f7e51..ebf321c 100644
--- a/KTp/service-availability-checker.cpp
+++ b/KTp/service-availability-checker.cpp
@@ -22,7 +22,7 @@
#include <QtDBus/QDBusPendingCall>
#include <QtDBus/QDBusReply>
-#include <KDebug>
+#include "ktp-debug.h"
namespace KTp
{
@@ -81,7 +81,7 @@ void ServiceAvailabilityChecker::onCallFinished(QDBusPendingCallWatcher *watcher
{
QDBusReply<QStringList> reply = *watcher;
if (!reply.isValid()) {
- kDebug() << "Got error while introspecting service availability:" << reply.error();
+ qCDebug(KTP_COMMONINTERNALS) << "Got error while introspecting service availability:" << reply.error();
} else {
if (watcher->objectName() == QLatin1String("ListActivatableNamesWatcher")) {
d->serviceActivatable = reply.value().contains(d->serviceName);
diff --git a/KTp/telepathy-handler-application.cpp b/KTp/telepathy-handler-application.cpp
index 8ebf537..4293b92 100644
--- a/KTp/telepathy-handler-application.cpp
+++ b/KTp/telepathy-handler-application.cpp
@@ -18,13 +18,13 @@
*/
#include "telepathy-handler-application.h"
-#include "debug.h"
+#include "ktp-debug.h"
#include <cstdlib>
#include <QTimer>
-#include <KCmdLineArgs>
-#include <KDebug>
+#include <KLocalizedString>
+#include "debug.h"
#include <TelepathyQt/Types>
#include <TelepathyQt/Debug>
@@ -104,11 +104,6 @@ void TelepathyHandlerApplication::Private::init(int initialTimeout, int timeout)
// Install TpQt4 debug callback
KTp::Debug::installCallback(s_debug);
- // Enable KDebug DBus interface
- // FIXME This must be enabled here because there is a bug in plasma
- // it should be removed when this is fixed
- kde_kdebug_enable_dbus_interface = s_debug;
-
if (!Private::s_persist) {
timer = new QTimer(q);
if (initialTimeout >= 0) {
diff --git a/KTp/wallet-interface.cpp b/KTp/wallet-interface.cpp
index 06a2dfa..c5ec0d9 100644
--- a/KTp/wallet-interface.cpp
+++ b/KTp/wallet-interface.cpp
@@ -21,7 +21,7 @@
#include "wallet-interface.h"
#include "pending-wallet.h"
-#include <KDebug>
+#include "ktp-debug.h"
class KTp::WalletInterfacePrivate : public QObject
@@ -81,7 +81,7 @@ KTp::PendingWallet* WalletInterface::openWallet()
void WalletInterfacePrivate::onWalletOpened(bool success)
{
if (!success) {
- kWarning() << "Couldn't open wallet";
+ qCWarning(KTP_COMMONINTERNALS) << "Couldn't open wallet";
}
disconnect(wallet.data(), SIGNAL(walletOpened(bool)), this, SLOT(onWalletOpened(bool)));
@@ -121,7 +121,7 @@ QString WalletInterface::password(const Tp::AccountPtr &account)
int rc = d->wallet->readPassword(account->uniqueIdentifier(), password);
if (rc != 0) {
password.clear();
- kWarning() << "failed to read password from KWallet";
+ qCWarning(KTP_COMMONINTERNALS) << "failed to read password from KWallet";
}
}
return password;
@@ -187,7 +187,7 @@ bool WalletInterface::hasEntry(const Tp::AccountPtr &account, const QString &key
if (d->wallet->hasEntry(d->mapsPrefix + account->uniqueIdentifier())) {
int rc = d->wallet->readMap(d->mapsPrefix + account->uniqueIdentifier(), map);
if (rc != 0) {
- kWarning() << "failed to read map from KWallet (probably it is not a map)";
+ qCWarning(KTP_COMMONINTERNALS) << "failed to read map from KWallet (probably it is not a map)";
return false;
}
}
@@ -206,7 +206,7 @@ QString WalletInterface::entry(const Tp::AccountPtr &account, const QString &key
if (d->wallet->hasEntry(d->mapsPrefix + account->uniqueIdentifier())) {
int rc = d->wallet->readMap(d->mapsPrefix + account->uniqueIdentifier(), map);
if (rc != 0) {
- kWarning() << "failed to read map from KWallet (probably it is not a map)";
+ qCWarning(KTP_COMMONINTERNALS) << "failed to read map from KWallet (probably it is not a map)";
return QString();
}
}
@@ -228,7 +228,7 @@ void WalletInterface::setEntry(const Tp::AccountPtr &account, const QString &key
if (d->wallet->hasEntry(d->mapsPrefix + account->uniqueIdentifier())) {
int rc = d->wallet->readMap(d->mapsPrefix + account->uniqueIdentifier(), map);
if (rc != 0) {
- kWarning() << "failed to read map from KWallet (probably it is not a map)";
+ qCWarning(KTP_COMMONINTERNALS) << "failed to read map from KWallet (probably it is not a map)";
return;
}
}
@@ -250,7 +250,7 @@ void WalletInterface::removeEntry(const Tp::AccountPtr &account, const QString &
if (d->wallet->hasEntry(d->mapsPrefix + account->uniqueIdentifier())) {
int rc = d->wallet->readMap(d->mapsPrefix + account->uniqueIdentifier(), map);
if (rc != 0) {
- kWarning() << "failed to read map from KWallet (probably it is not a map)";
+ qCWarning(KTP_COMMONINTERNALS) << "failed to read map from KWallet (probably it is not a map)";
return;
}
}
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list