Commit 3becd7cc authored by Laurent Montel's avatar Laurent Montel 😁

Port to qCDebug

parent e3fe45b9
......@@ -61,6 +61,7 @@ set(akonadicontact_editor_SRCS
)
set(akonadicontact_LIB_SRC
akonadi_contact_debug.cpp
abstractcontactformatter.cpp
abstractcontactgroupformatter.cpp
attributeregistrar.cpp
......
/* 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 "akonadi_contact_debug.h"
Q_LOGGING_CATEGORY(AKONADICONTACT_LOG, "log_akonadi_contact")
/* 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 AKONADI_CONTACT_DEBUG_H
#define AKONADI_CONTACT_DEBUG_H
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(AKONADICONTACT_LOG)
#endif
......@@ -53,7 +53,7 @@ class Item;
* ...
*
* if ( !editor->saveContactInAddressBook() ) {
* qDebug() << "Unable to save new contact to storage";
* qCDebug(AKONADICONTACT_LOG) << "Unable to save new contact to storage";
* return;
* }
*
......
......@@ -52,7 +52,7 @@ class Item;
* ...
*
* if ( !editor->saveContactGroup() ) {
* qDebug() << "Unable to save new contact group to storage";
* qCDebug(AKONADICONTACT_LOG) << "Unable to save new contact group to storage";
* return;
* }
*
......@@ -70,7 +70,7 @@ class Item;
* ...
*
* if ( !editor->saveContactGroup() ) {
* qDebug() << "Unable to save changed contact group to storage";
* qCDebug(AKONADICONTACT_LOG) << "Unable to save changed contact group to storage";
* return;
* }
*
......
......@@ -20,7 +20,7 @@
*/
#include "contactgroupexpandjob.h"
#include "akonadi_contact_debug.h"
#include <contactgroupsearchjob.h>
#include <itemfetchjob.h>
#include <itemfetchscope.h>
......@@ -117,7 +117,7 @@ public:
mContacts.append(contact);
} else {
qWarning() << "Contact for Akonadi item" << item.id() << "does not exist anymore!";
qCWarning(AKONADICONTACT_LOG) << "Contact for Akonadi item" << item.id() << "does not exist anymore!";
}
}
......
......@@ -23,15 +23,12 @@
#include <kiconloader.h>
#include <kservicetypetrader.h>
IMProtocols *IMProtocols::mSelf = Q_NULLPTR;
IMProtocols::IMProtocols()
{
KIconLoader::global()->addAppDir(QStringLiteral("akonadi/contact"));
const QList<KPluginInfo> list = KPluginInfo::fromServices(KServiceTypeTrader::self()->query(QStringLiteral("KABC/IMProtocol")));
// sort the protocol information by user visible name
QMap<QString, KPluginInfo> sortingMap;
foreach (const KPluginInfo &info, list) {
......
......@@ -47,7 +47,7 @@ namespace Akonadi {
* if ( dlg.exec() ) {
* const Akonadi::EmailAddressSelectionWidget::Selection::List selections = dlg.selectedAddresses();
* foreach ( const Akonadi::EmailAddressSelectionWidget::Selection &selection, selections ) {
* qDebug() << "Name:" << selection.name() << "Email:" << selection.email();
* qCDebug(AKONADICONTACT_LOG) << "Name:" << selection.name() << "Email:" << selection.email();
* }
* }
*
......
......@@ -55,7 +55,7 @@ namespace Akonadi {
* ...
*
* foreach ( const Akonadi::EmailAddressSelection &selection, widget->selectedAddresses() ) {
* qDebug() << "Name:" << selection.name() << "Email:" << selection.email();
* qCDebug(AKONADICONTACT_LOG) << "Name:" << selection.name() << "Email:" << selection.email();
* }
*
* @endcode
......
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