summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2014-10-14 05:33:54 (GMT)
committerMontel Laurent <montel@kde.org>2014-10-14 05:34:52 (GMT)
commitf762d8a8c495c9f0d85c795b68b02bf0d93ea88b (patch)
tree8a5ab6665d392f5251efb1531da5446882ff0731
parent953a731c4bb172ba6db5a7bccbdba121f4d61d1a (diff)
Port to qCDebug()
-rw-r--r--generators/spectre/CMakeLists.txt1
-rw-r--r--generators/spectre/generator_ghostview.cpp10
-rw-r--r--generators/spectre/rendererthread.cpp5
-rw-r--r--generators/spectre/spectre_debug.cpp23
-rw-r--r--generators/spectre/spectre_debug.h27
5 files changed, 58 insertions, 8 deletions
diff --git a/generators/spectre/CMakeLists.txt b/generators/spectre/CMakeLists.txt
index a6c5b9c..bb6752c 100644
--- a/generators/spectre/CMakeLists.txt
+++ b/generators/spectre/CMakeLists.txt
@@ -11,6 +11,7 @@ include_directories(
set(okularGenerator_ghostview_SRCS
generator_ghostview.cpp
rendererthread.cpp
+ spectre_debug.cpp
)
ki18n_wrap_ui(okularGenerator_ghostview_SRCS
diff --git a/generators/spectre/generator_ghostview.cpp b/generators/spectre/generator_ghostview.cpp
index 76ad910..ebb2ffc 100644
--- a/generators/spectre/generator_ghostview.cpp
+++ b/generators/spectre/generator_ghostview.cpp
@@ -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());
diff --git a/generators/spectre/rendererthread.cpp b/generators/spectre/rendererthread.cpp
index 9fc91fc..07ec586 100644
--- a/generators/spectre/rendererthread.cpp
+++ b/generators/spectre/rendererthread.cpp
@@ -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);
diff --git a/generators/spectre/spectre_debug.cpp b/generators/spectre/spectre_debug.cpp
new file mode 100644
index 0000000..dc05a1c
--- /dev/null
+++ b/generators/spectre/spectre_debug.cpp
@@ -0,0 +1,23 @@
+/* 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")
+
+
diff --git a/generators/spectre/spectre_debug.h b/generators/spectre/spectre_debug.h
new file mode 100644
index 0000000..a4d50fb
--- /dev/null
+++ b/generators/spectre/spectre_debug.h
@@ -0,0 +1,27 @@
+/* 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
+