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

Port to QCDebug

parent 719ac54e
set(akonadiwidgets_SRCS
akonadiwidgets_debug.cpp
actionstatemanager.cpp
agentactionmanager.cpp
agentinstancewidget.cpp
......
......@@ -56,7 +56,7 @@ class AgentFilterProxyModel;
*
* MyWidget::slotInstanceSelected( Akonadi::AgentInstance &instance )
* {
* qDebug() << "Selected instance" << instance.name();
* qCDebug(AKONADIWIDGETS_LOG) << "Selected instance" << instance.name();
* }
*
* @endcode
......
/* 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 "akonadiwidgets_debug.h"
Q_LOGGING_CATEGORY(AKONADIWIDGETS_LOG, "akonadiwidgets_log")
/* 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 AKONADIWIDGETS_DEBUG_H
#define AKONADIWIDGETS_DEBUG_H
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(AKONADIWIDGETS_LOG)
#endif
......@@ -25,7 +25,7 @@
#include "collectiongeneralpropertiespage_p.h"
#include "collectionmodifyjob.h"
#include <qdebug.h>
#include "akonadiwidgets_debug.h"
#include <ksharedconfig.h>
#include <KConfigGroup>
......@@ -62,7 +62,7 @@ public:
{
if (job->error()) {
// TODO
qWarning() << job->errorString();
qCWarning(AKONADIWIDGETS_LOG) << job->errorString();
}
q->deleteLater();
}
......
......@@ -22,7 +22,7 @@
#include "collectionstatisticsmodel.h"
#include <kcolorscheme.h>
#include <qdebug.h>
#include "akonadiwidgets_debug.h"
#include <kio/global.h>
#include <QPainter>
......@@ -259,7 +259,7 @@ void CollectionStatisticsDelegate::paint(QPainter *painter,
// Construct the string which will appear after the foldername (with the
// unread count)
QString unread;
// qDebug() << expanded << unreadCount << unreadRecursiveCount;
// qCDebug(AKONADIWIDGETS_LOG) << expanded << unreadCount << unreadRecursiveCount;
if (expanded && unreadCount > 0) {
unread = QString::fromLatin1(" (%1)").arg(unreadCount);
} else if (!expanded) {
......
......@@ -25,7 +25,7 @@
#include <QAction>
#include <QMimeData>
#include <qdebug.h>
#include "akonadiwidgets_debug.h"
#include <klocalizedstring.h>
#include <kmessagebox.h>
#include <QUrl>
......
......@@ -20,7 +20,7 @@
#include "dragdropmanager_p.h"
#include "specialcollectionattribute.h"
#include "collectionutils.h"
#include "akonadiwidgets_debug.h"
#include <QApplication>
#include <QDropEvent>
#include <QMenu>
......@@ -161,7 +161,7 @@ bool DragDropManager::processDropEvent(QDropEvent *event, bool &menuCanceled, bo
}
if (!moveAllowed && !copyAllowed && !linkAllowed) {
qDebug() << "Cannot drop here:" << event->possibleActions() << m_view->model()->supportedDragActions() << m_view->model()->supportedDropActions();
qCDebug(AKONADIWIDGETS_LOG) << "Cannot drop here:" << event->possibleActions() << m_view->model()->supportedDragActions() << m_view->model()->supportedDropActions();
return false;
}
......@@ -191,7 +191,7 @@ bool DragDropManager::processDropEvent(QDropEvent *event, bool &menuCanceled, bo
}
if (actionCount == 1) {
qDebug() << "Selecting drop action" << defaultAction << ", there are no other possibilities";
qCDebug(AKONADIWIDGETS_LOG) << "Selecting drop action" << defaultAction << ", there are no other possibilities";
event->setDropAction(defaultAction);
return true;
}
......
......@@ -28,7 +28,7 @@
#include <QDragMoveEvent>
#include <QMenu>
#include <qdebug.h>
#include "akonadiwidgets_debug.h"
#include <kxmlguiclient.h>
#include <KXMLGUIFactory>
......
......@@ -24,7 +24,7 @@
#include "subscriptionjob_p.h"
#include "subscriptionmodel_p.h"
#include <qdebug.h>
#include "akonadiwidgets_debug.h"
#include <ksharedconfig.h>
#include <klocalizedstring.h>
......@@ -89,7 +89,7 @@ public:
{
if (job->error()) {
// TODO
qWarning() << job->errorString();
qCWarning(AKONADIWIDGETS_LOG) << job->errorString();
}
q->deleteLater();
}
......
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