Commit bde7e8f5 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use qCDebug/qCWarning

parent 0dd1bd99
include_directories(${CMAKE_SOURCE_DIR}/kaddressbook)
set(kontact_kaddressbookplugin_PART_SRCS
set(kontact_kaddressbookplugin_PART_SRCS kaddressbookplugin_debug.cpp
kaddressbook_plugin.cpp
)
......
......@@ -27,7 +27,7 @@
#include <QAction>
#include <KActionCollection>
#include <KCmdLineArgs>
#include <QDebug>
#include "kaddressbookplugin_debug.h"
#include <KLocalizedString>
#include <QIcon>
......@@ -98,7 +98,7 @@ void KAddressBookPlugin::slotNewContact()
}
if (part->metaObject()->indexOfMethod("newContact()") == -1) {
qWarning() << "KAddressBook part is missing slot newContact()";
qCWarning(KADDRESSBOOKPLUGIN_LOG) << "KAddressBook part is missing slot newContact()";
return;
}
......@@ -113,7 +113,7 @@ void KAddressBookPlugin::slotNewContactGroup()
}
if (part->metaObject()->indexOfMethod("newGroup()") == -1) {
qWarning() << "KAddressBook part is missing slot newGroup()";
qCWarning(KADDRESSBOOKPLUGIN_LOG) << "KAddressBook part is missing slot newGroup()";
return;
}
......@@ -163,7 +163,7 @@ void KAddressBookPlugin::shortcutChanged()
KParts::ReadOnlyPart *localPart = part();
if (localPart) {
if (localPart->metaObject()->indexOfMethod("updateQuickSearchText()") == -1) {
qWarning() << "KAddressBook part is missing slot updateQuickSearchText()";
qCWarning(KADDRESSBOOKPLUGIN_LOG) << "KAddressBook part is missing slot updateQuickSearchText()";
return;
}
QMetaObject::invokeMethod(localPart, "updateQuickSearchText");
......@@ -180,7 +180,7 @@ void KAddressBookPlugin::slotSyncContacts()
message << QString("Contact");
QDBusConnection::sessionBus().send(message);
#else
qWarning() << QStringLiteral(" Need to port to AKONADI: KAddressBookPlugin::slotSyncNotes");
qCWarning(KADDRESSBOOKPLUGIN_LOG) << QStringLiteral(" Need to port to AKONADI: KAddressBookPlugin::slotSyncNotes");
#endif
}
......
/* This file is part of the KDE project
Copyright (C) 2015 Laurent Montel <montel@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.
*/
#include "kaddressbookplugin_debug.h"
Q_LOGGING_CATEGORY(KADDRESSBOOKPLUGIN_LOG, "log_kaddressbook_plugin")
/* This file is part of the KDE project
Copyright (C) 2015 Laurent Montel <montel@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 KADDRESSBOOKPLUGIN_DEBUG_H
#define KADDRESSBOOKPLUGIN_DEBUG_H
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(KADDRESSBOOKPLUGIN_LOG)
#endif
......@@ -16,6 +16,7 @@
*/
#include "mergecontactselectlistwidget.h"
#include "kaddressbook_debug.h"
#include <KContacts/Addressee>
#include <KLocalizedString>
#include <KGlobal>
......@@ -60,7 +61,7 @@ void MergeContactSelectListWidget::updateTitle()
QString title;
switch (mConflictType) {
case MergeContacts::None:
qWarning() << " MergeContacts::None used in updateTitle. It's a bug";
qCWarning(KADDRESSBOOK_LOG) << " MergeContacts::None used in updateTitle. It's a bug";
// it's not possible.
break;
case MergeContacts::Birthday:
......
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