From kde-commits Thu Apr 30 21:01:32 2015 From: Montel Laurent Date: Thu, 30 Apr 2015 21:01:32 +0000 To: kde-commits Subject: [kdepim-runtime] /: Port to qCDebug Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=143042770414757 Git commit 71bd8a11a12dc2ec83467b787032305b5d3e7d0d by Montel Laurent. Committed on 30/04/2015 at 21:01. Pushed by mlaurent into branch 'master'. Port to qCDebug M +1 -1 kdepim-runtime.categories M +1 -0 resources/contacts/CMakeLists.txt A +23 -0 resources/contacts/contacts_resources_debug.cpp [License= : LGPL (v2+)] A +27 -0 resources/contacts/contacts_resources_debug.h [License: = LGPL (v2+)] M +4 -4 resources/contacts/contactsresource.cpp http://commits.kde.org/kdepim-runtime/71bd8a11a12dc2ec83467b787032305b5d3e7= d0d diff --git a/kdepim-runtime.categories b/kdepim-runtime.categories index 0fe9bf7..91b1e1a 100644 --- a/kdepim-runtime.categories +++ b/kdepim-runtime.categories @@ -15,4 +15,4 @@ log_kalarmdirresource kalarm directory resource (kdepim-r= untime) log_pop3resource pop3 resource (kdepim-runtime) log_akonadi_serializer_kalarm akonadi serializer plugins (kdepim-runtime) log_akonadi_serializer_mail akonadi mail plugins (kdepim-runtime) - +log_resources_contacts contacts resource (kdepim-runtime) diff --git a/resources/contacts/CMakeLists.txt b/resources/contacts/CMakeLi= sts.txt index 92edde9..7495280 100644 --- a/resources/contacts/CMakeLists.txt +++ b/resources/contacts/CMakeLists.txt @@ -9,6 +9,7 @@ add_definitions(-DTRANSLATION_DOMAIN=3D\"akonadi_contacts_r= esource\") set( contactsresource_SRCS contactsresource.cpp settingsdialog.cpp + contacts_resources_debug.cpp ) = ki18n_wrap_ui(contactsresource_SRCS settingsdialog.ui) diff --git a/resources/contacts/contacts_resources_debug.cpp b/resources/co= ntacts/contacts_resources_debug.cpp new file mode 100644 index 0000000..64aaa1c --- /dev/null +++ b/resources/contacts/contacts_resources_debug.cpp @@ -0,0 +1,23 @@ +/* This file is part of the KDE project + Copyright (C) 2015 Laurent Montel + + 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 Lice= nse + 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 "contacts_resources_debug.h" +Q_LOGGING_CATEGORY(CONTACTSRESOURCES_LOG, "log_resources_contacts") + + diff --git a/resources/contacts/contacts_resources_debug.h b/resources/cont= acts/contacts_resources_debug.h new file mode 100644 index 0000000..ec03780 --- /dev/null +++ b/resources/contacts/contacts_resources_debug.h @@ -0,0 +1,27 @@ +/* This file is part of the KDE project + Copyright (C) 2015 Laurent Montel + + 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 Lice= nse + 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 CONTACTS_RESOURCES_DEBUG_H +#define CONTACTS_RESOURCES_DEBUG_H + +#include +Q_DECLARE_LOGGING_CATEGORY(CONTACTSRESOURCES_LOG) + +#endif = + diff --git a/resources/contacts/contactsresource.cpp b/resources/contacts/c= ontactsresource.cpp index 31c1648..3ebbd16 100644 --- a/resources/contacts/contactsresource.cpp +++ b/resources/contacts/contactsresource.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include "contacts_resources_debug.h" = #include = @@ -271,7 +271,7 @@ void ContactsResource::itemAdded(const Akonadi::Item &i= tem, const Akonadi::Colle newItem.setRemoteId(group.id() + QLatin1String(".ctg")); = } else { - qWarning() << "got item without (usable) payload, ignoring it"; + qCWarning(CONTACTSRESOURCES_LOG) << "got item without (usable) pay= load, ignoring it"; } = changeCommitted(newItem); @@ -521,13 +521,13 @@ Collection::Rights ContactsResource::supportedRights(= bool isResourceCollection) QString ContactsResource::directoryForCollection(const Collection &collect= ion) const { if (collection.remoteId().isEmpty()) { - qWarning() << "Got incomplete ancestor chain:" << collection; + qCWarning(CONTACTSRESOURCES_LOG) << "Got incomplete ancestor chain= :" << collection; return QString(); } = if (collection.parentCollection() =3D=3D Collection::root()) { if (collection.remoteId() !=3D baseDirectoryPath()) - qWarning() << "RID mismatch, is " << collection.remoteId() + qCWarning(CONTACTSRESOURCES_LOG) << "RID mismatch, is " << col= lection.remoteId() << " expected " << baseDirectoryPath(); return collection.remoteId(); }