Commit 9982e458 authored by Martin Klapetek's avatar Martin Klapetek
Browse files

[logviewer] Port kDebugs to qCDebugs

parent 21cbbc7f
......@@ -23,7 +23,6 @@
#include <KConfig>
#include <KConfigGroup>
#include <KDebug>
K_PLUGIN_FACTORY(KCMTelepathyLogViewerBehaviorConfigFactory, registerPlugin<BehaviorConfig>();)
K_EXPORT_PLUGIN(KCMTelepathyLogViewerBehaviorConfigFactory("ktp_logviewer_behavior", "kcm_ktp_logviewer_behavior"))
......@@ -60,8 +59,6 @@ void BehaviorConfig::load()
void BehaviorConfig::save()
{
kDebug();
KConfig config(QLatin1String("ktelepathyrc"));
KConfigGroup group = config.group("LogViewer");
group.writeEntry(QLatin1String("SortMode"), ui->sortButtonGroup->checkedId());
......
......@@ -27,7 +27,6 @@
#include <KLocalizedString>
#include <klocalizeddate.h>
#include <KDebug>
Q_DECLARE_METATYPE(Tp::AccountPtr)
......
/* This file is part of the KDE project
Copyright (C) 2014 Martin Klapetek <mklapetek@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KTP_LOGVIEWER_DEBUG_H
#define KTP_LOGVIEWER_DEBUG_H
#include <QLoggingCategory>
#include <QDebug>
Q_DECLARE_LOGGING_CATEGORY(KTP_LOGVIEWER)
#endif
......@@ -24,8 +24,6 @@
#include <TelepathyQt/Types>
#include <KDebug>
EntityFilterModel::EntityFilterModel(QObject *parent):
QSortFilterProxyModel(parent)
{
......@@ -83,14 +81,12 @@ bool EntityFilterModel::filterAcceptsRow(int source_row, const QModelIndex &sour
/* Check if contact's account name matches */
if (entity.alias().contains(term, Qt::CaseInsensitive) && matches_filter) {
kDebug() << entity.alias() << "matches" << term;
return matches_filter;
}
/* If there's information about contact's real name try to match it too */
if (!contact.isNull()) {
if (contact->alias().contains(term, Qt::CaseInsensitive) && matches_filter) {
kDebug() << contact->alias() << "matches" << term;
return matches_filter;
}
}
......
......@@ -30,8 +30,6 @@
#include <TelepathyQt/PendingOperation>
#include <TelepathyQt/PendingContacts>
#include <KDebug>
class EntityModelItem
{
public:
......
......@@ -26,7 +26,6 @@
#include <QFontDatabase>
#include <KIconLoader>
#include <KDebug>
#include <TelepathyQt/Account>
......
......@@ -20,6 +20,7 @@
#include "log-viewer.h"
#include "ui_log-viewer.h"
#include "debug.h"
#include <TelepathyQt/AccountManager>
#include <TelepathyQt/PendingReady>
......@@ -38,8 +39,6 @@
#include <KLineEdit>
#include <KPixmapSequence>
#include <KMessageBox>
#include <KDebug>
#include <KStandardAction>
#include <KMenu>
#include <KApplication>
......@@ -455,7 +454,7 @@ void LogViewer::slotImportKopeteLogs(bool force)
bool importDone = logsConfig.readEntry(QLatin1String("InitialKopeteImportDone"), QVariant(false)).toBool();
if (!force && importDone) {
kDebug() << "Skipping initial Kopete logs import, already done.";
qCDebug(KTP_LOGVIEWER) << "Skipping initial Kopete logs import, already done.";
return;
}
......@@ -469,7 +468,7 @@ void LogViewer::slotImportKopeteLogs(bool force)
}
}
kDebug() << "Initial Kopete logs import: found" << matchingAccounts.count() << "accounts to import";
qCDebug(KTP_LOGVIEWER) << "Initial Kopete logs import: found" << matchingAccounts.count() << "accounts to import";
if (!matchingAccounts.isEmpty()) {
LogsImportDialog *dialog = new LogsImportDialog(this);
......
......@@ -23,11 +23,14 @@
#include "log-viewer.h"
#include "../ktptextui_version.h"
#include "debug.h"
#include <TelepathyQt/AccountManager>
#include <KTp/contact-factory.h>
Q_LOGGING_CATEGORY(KTP_LOGVIEWER, "ktp-logviewer")
int main(int argc, char *argv[])
{
K4AboutData aboutData("ktp-log-viewer",
......
......@@ -23,7 +23,6 @@
#include "adium-theme-status-info.h"
#include <KTp/message-processor.h>
#include <KDebug>
#include <KConfig>
#include <KIconLoader>
#include <KLocalizedString>
......
......@@ -19,6 +19,7 @@
#include "person-entity-merge-model.h"
#include "entity-model.h"
#include "debug.h"
#include <KTp/Logger/log-entity.h>
#include <KTp/Models/contacts-model.h>
......@@ -27,7 +28,6 @@
#include <TelepathyQt/Contact>
#include <TelepathyQt/ContactManager>
#include <KDebug>
#include <KLocalizedString>
#include <KIconLoader>
......@@ -123,13 +123,13 @@ PersonEntityMergeModel::ContactItem* PersonEntityMergeModel::itemForPersona(cons
ContactItem *cItem = dynamic_cast<ContactItem*>(item);
Q_ASSERT(cItem);
if (cItem->personaIndex == personsModel_personaIndex) {
kDebug() << "\t\tFound existing persona for" << personsModel_personaIndex.data();
qCDebug(KTP_LOGVIEWER) << "\t\tFound existing persona for" << personsModel_personaIndex.data();
return cItem;
}
}
}
kDebug() << "\t\tCreating a new persona for" << personsModel_personaIndex.data();
qCDebug(KTP_LOGVIEWER) << "\t\tCreating a new persona for" << personsModel_personaIndex.data();
ContactItem *item = new ContactItem;
item->personaIndex = personsModel_personaIndex;
......@@ -163,12 +163,12 @@ PersonEntityMergeModel::GroupItem* PersonEntityMergeModel::groupForName(const QV
Q_ASSERT(group);
if (group->label == groupName) {
kDebug() << "\tFound matching group" << groupName;
qCDebug(KTP_LOGVIEWER) << "\tFound matching group" << groupName;
return group;
}
}
kDebug() << "\tCreating a new group" << groupName;
qCDebug(KTP_LOGVIEWER) << "\tCreating a new group" << groupName;
GroupItem *group = new GroupItem;
group->label = groupName;
addItem(group, m_rootItem);
......@@ -216,7 +216,7 @@ PersonEntityMergeModel::Item* PersonEntityMergeModel::itemForIndex(const QModelI
return 0;
}
kDebug() << index;
qCDebug(KTP_LOGVIEWER) << index;
Q_ASSERT(false && "Invalid index model");
return 0;
}
......@@ -409,7 +409,7 @@ void PersonEntityMergeModel::sourceModelInitialized()
void PersonEntityMergeModel::initializeModel()
{
kDebug();
qCDebug(KTP_LOGVIEWER);
for (int i = 0; i < m_entityModel->rowCount(QModelIndex()); ++i) {
const QModelIndex entityIndex = m_entityModel->index(i, 0);
......@@ -419,7 +419,7 @@ void PersonEntityMergeModel::initializeModel()
const KTp::LogEntity entity = entityIndex.data(EntityModel::EntityRole).value<KTp::LogEntity>();
const Tp::AccountPtr account = entityIndex.data(EntityModel::AccountRole).value<Tp::AccountPtr>();
kDebug() << "Searching for match for entity" << entity.id() << "@" << account->uniqueIdentifier();
qCDebug(KTP_LOGVIEWER) << "Searching for match for entity" << entity.id() << "@" << account->uniqueIdentifier();
if (KTp::kpeopleEnabled()) {
for (int j = 0; j < m_contactsModel->rowCount(); ++j) {
const QModelIndex index = m_contactsModel->index(j, 0);
......@@ -427,8 +427,8 @@ void PersonEntityMergeModel::initializeModel()
for (int k = 0; k < m_contactsModel->rowCount(index); ++k) {
const QModelIndex childIndex = m_contactsModel->index(k, 0, index);
if (m_contactsModel->data(childIndex, KTp::IdRole).toString() == entity.id()) {
//kDebug() << "\tFound matching persona" << m_personsModel->data(index, PersonsModel::UriRole).toString();
//kDebug() << "\t\tFound matching contact" << m_personsModel->data(childIndex, PersonsModel::IMRole).toString();
//qCDebug(KTP_LOGVIEWER) << "\tFound matching persona" << m_personsModel->data(index, PersonsModel::UriRole).toString();
//qCDebug(KTP_LOGVIEWER) << "\t\tFound matching contact" << m_personsModel->data(childIndex, PersonsModel::IMRole).toString();
parentItem = itemForPersona(index);
personaIndex = index;
contactIndex = childIndex;
......@@ -444,7 +444,7 @@ void PersonEntityMergeModel::initializeModel()
}
if (!contactIndex.isValid() && !personaIndex.isValid()) {
kDebug() << "\tNo match";
qCDebug(KTP_LOGVIEWER) << "\tNo match";
// If we don't have kpeople, we don't have information about group
// membership, so fallback to grouping by account
if (KTp::kpeopleEnabled()) {
......
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