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

Port to qCDebug()

parent 953a731c
......@@ -11,6 +11,7 @@ include_directories(
set(okularGenerator_ghostview_SRCS
generator_ghostview.cpp
rendererthread.cpp
spectre_debug.cpp
)
ki18n_wrap_ui(okularGenerator_ghostview_SRCS
......
......@@ -23,7 +23,6 @@
#include <QMimeType>
#include <QMimeDatabase>
#include <ktemporaryfile.h>
#include <KDebug>
#include <QDir>
#include <KLocalizedString>
......@@ -35,6 +34,7 @@
#include "ui_gssettingswidget.h"
#include "gssettings.h"
#include "spectre_debug.h"
#include "rendererthread.h"
static KAboutData createAboutData()
......@@ -166,13 +166,13 @@ bool GSGenerator::loadDocument( const QString & fileName, QVector< Okular::Page
const SpectreStatus loadStatus = spectre_document_status(m_internalDocument);
if (loadStatus != SPECTRE_STATUS_SUCCESS)
{
kDebug(4711) << "ERR:" << spectre_status_to_string(loadStatus);
qCDebug(OkularSpectreDebug) << "ERR:" << spectre_status_to_string(loadStatus);
spectre_document_free(m_internalDocument);
m_internalDocument = 0;
return false;
}
pagesVector.resize( spectre_document_get_n_pages(m_internalDocument) );
kDebug(4711) << "Page count:" << pagesVector.count();
qCDebug(OkularSpectreDebug) << "Page count:" << pagesVector.count();
return loadPages(pagesVector);
}
......@@ -209,7 +209,7 @@ bool GSGenerator::loadPages( QVector< Okular::Page * > & pagesVector )
SpectreOrientation pageOrientation = SPECTRE_ORIENTATION_PORTRAIT;
page = spectre_document_get_page (m_internalDocument, i);
if (spectre_document_status (m_internalDocument)) {
kDebug(4711) << "Error getting page" << i << spectre_status_to_string(spectre_document_status(m_internalDocument));
qCDebug(OkularSpectreDebug) << "Error getting page" << i << spectre_status_to_string(spectre_document_status(m_internalDocument));
} else {
spectre_page_get_size(page, &width, &height);
pageOrientation = spectre_page_get_orientation(page);
......@@ -223,7 +223,7 @@ bool GSGenerator::loadPages( QVector< Okular::Page * > & pagesVector )
void GSGenerator::generatePixmap( Okular::PixmapRequest * req )
{
kDebug(4711) << "receiving" << *req;
qCDebug(OkularSpectreDebug) << "receiving" << *req;
SpectrePage *page = spectre_document_get_page(m_internalDocument, req->pageNumber());
......
......@@ -11,8 +11,7 @@
#include <qimage.h>
#include <QtCore/QDebug>
#include <KDebug>
#include "spectre_debug.h"
#include "core/generator.h"
#include "core/page.h"
......@@ -120,7 +119,7 @@ void GSRendererThread::run()
if (image->width() != req.request->width() || image->height() != req.request->height())
{
kWarning(4711).nospace() << "Generated image does not match wanted size: "
qCWarning(OkularSpectreDebug).nospace() << "Generated image does not match wanted size: "
<< "[" << image->width() << "x" << image->height() << "] vs requested "
<< "[" << req.request->width() << "x" << req.request->height() << "]";
QImage aux = image->scaled(wantedWidth, wantedHeight);
......
/* This file is part of the KDE project
Copyright (C) 2014 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 "spectre_debug.h"
Q_LOGGING_CATEGORY(OkularSpectreDebug, "OkularSpectreDebug")
/* This file is part of the KDE project
Copyright (C) 2014 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 SPECTRE_DEBUG_H
#define SPECTRE_DEBUG_H
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(OkularSpectreDebug)
#endif
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