diff --git a/core/document.cpp b/core/document.cpp index 8a6a0fd2b..468a8a9fb 100644 --- a/core/document.cpp +++ b/core/document.cpp @@ -732,7 +732,7 @@ bool DocumentPrivate::openRelativeFile( const QString & fileName ) Generator * DocumentPrivate::loadGeneratorLibrary( const KPluginMetaData &service ) { KPluginLoader loader( service.fileName() ); - qDebug() << service.fileName(); + qCDebug(OkularCoreDebug) << service.fileName(); KPluginFactory *factory = loader.factory(); if ( !factory ) { diff --git a/generators/kimgio/CMakeLists.txt b/generators/kimgio/CMakeLists.txt index aeac0af1b..467a5cde8 100644 --- a/generators/kimgio/CMakeLists.txt +++ b/generators/kimgio/CMakeLists.txt @@ -10,7 +10,7 @@ okular_add_generator(okularGenerator_kimgio generator_kimgio.cpp) target_link_libraries(okularGenerator_kimgio okularcore KF5::KExiv2 KF5::I18n) add_definitions( -DKDESRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/" ) -set( kimgiotest_SRCS tests/kimgiotest.cpp ${CMAKE_SOURCE_DIR}/ui/pagepainter.cpp ${CMAKE_SOURCE_DIR}/ui/guiutils.cpp ) +set( kimgiotest_SRCS tests/kimgiotest.cpp ${CMAKE_SOURCE_DIR}/ui/pagepainter.cpp ${CMAKE_SOURCE_DIR}/ui/guiutils.cpp ${CMAKE_SOURCE_DIR}/ui/debug_ui.cpp ) ecm_add_test(${kimgiotest_SRCS} TEST_NAME "kimgiotest" LINK_LIBRARIES okularcore okularpart Qt5::Svg Qt5::Test) target_compile_definitions(kimgiotest PRIVATE -DGENERATOR_PATH="$") diff --git a/mobile/components/CMakeLists.txt b/mobile/components/CMakeLists.txt index 9da375fd6..f1af2602a 100644 --- a/mobile/components/CMakeLists.txt +++ b/mobile/components/CMakeLists.txt @@ -13,6 +13,7 @@ set(okular_SRCS ${CMAKE_SOURCE_DIR}/ui/guiutils.cpp ${CMAKE_SOURCE_DIR}/ui/tocmodel.cpp ${CMAKE_SOURCE_DIR}/ui/pagepainter.cpp + ${CMAKE_SOURCE_DIR}/ui/debug_ui.cpp pageitem.cpp documentitem.cpp thumbnailitem.cpp diff --git a/ui/annotationproxymodels.cpp b/ui/annotationproxymodels.cpp index 2a04a4841..285307d2f 100644 --- a/ui/annotationproxymodels.cpp +++ b/ui/annotationproxymodels.cpp @@ -15,6 +15,7 @@ #include #include "annotationmodel.h" +#include "debug_ui.h" static quint32 mixIndex( int row, int column ) { @@ -289,7 +290,7 @@ class AuthorGroupItem QString prefix; for ( int i = 0; i < level; ++i ) prefix += QLatin1Char(' '); - qDebug( "%s%s", qPrintable( prefix ), ( mType == Page ? "Page" : (mType == Author ? "Author" : "Annotation") ) ); + qCDebug(OkularUiDebug, "%s%s", qPrintable( prefix ), ( mType == Page ? "Page" : (mType == Author ? "Author" : "Annotation") ) ); for ( int i = 0; i < mChilds.count(); ++i ) mChilds[ i ]->dump( level + 2 ); diff --git a/ui/formwidgets.cpp b/ui/formwidgets.cpp index 7e68b5c7b..4adbccb60 100644 --- a/ui/formwidgets.cpp +++ b/ui/formwidgets.cpp @@ -92,7 +92,7 @@ QButtonGroup* FormWidgetsController::registerRadioButton( QAbstractButton *butto const QList< int >::const_iterator idsIt = qFind( (*it).ids, id ); if ( idsIt != (*it).ids.constEnd() ) { - qDebug(OkularUiDebug) << "Adding id" << id << "To group including" << (*it).ids; + qCDebug(OkularUiDebug) << "Adding id" << id << "To group including" << (*it).ids; (*it).group->addButton( button ); (*it).group->setId( button, id ); return (*it).group; diff --git a/ui/pagepainter.cpp b/ui/pagepainter.cpp index db82119ca..c5eb1ef90 100644 --- a/ui/pagepainter.cpp +++ b/ui/pagepainter.cpp @@ -33,6 +33,7 @@ #include "core/observer.h" #include "core/tile.h" #include "settings_core.h" +#include "ui/debug_ui.h" Q_GLOBAL_STATIC_WITH_ARGS( QPixmap, busyPixmap, ( KIconLoader::global()->loadIcon(QLatin1String("okular"), KIconLoader::NoGroup, 32, KIconLoader::DefaultState, QStringList(), 0, true) ) ) @@ -881,7 +882,7 @@ void PagePainter::cropPixmapOnImage( QImage & dest, const QPixmap * src, const Q void PagePainter::recolor(QImage *image, const QColor &foreground, const QColor &background) { if (image->format() != QImage::Format_ARGB32_Premultiplied) { - qWarning() << "Wrong image format! Converting..."; + qCWarning(OkularUiDebug) << "Wrong image format! Converting..."; *image = image->convertToFormat(QImage::Format_ARGB32_Premultiplied); } diff --git a/ui/pageview.cpp b/ui/pageview.cpp index 94073c329..8992539c7 100644 --- a/ui/pageview.cpp +++ b/ui/pageview.cpp @@ -1220,7 +1220,7 @@ void PageView::slotRealNotifyViewportChanged( bool smoothMove ) } if ( !item ) { - qWarning() << "viewport for page" << vp.pageNumber << "has no matching item!"; + qCWarning(OkularUiDebug) << "viewport for page" << vp.pageNumber << "has no matching item!"; d->blockViewport = false; return; } @@ -2752,7 +2752,7 @@ void PageView::mouseReleaseEvent( QMouseEvent * e ) { // request the textpage if there isn't one okularPage= item->page(); - qWarning() << "checking if page" << item->pageNumber() << "has text:" << okularPage->hasTextPage(); + qCDebug(OkularUiDebug) << "checking if page" << item->pageNumber() << "has text:" << okularPage->hasTextPage(); if ( !okularPage->hasTextPage() ) d->document->requestTextPage( okularPage->number() ); // grab text in the rect that intersects itemRect @@ -2907,7 +2907,7 @@ void PageView::mouseReleaseEvent( QMouseEvent * e ) { // request the textpage if there isn't one okularPage= item->page(); - qWarning() << "checking if page" << item->pageNumber() << "has text:" << okularPage->hasTextPage(); + qCDebug(OkularUiDebug) << "checking if page" << item->pageNumber() << "has text:" << okularPage->hasTextPage(); if ( !okularPage->hasTextPage() ) d->document->requestTextPage( okularPage->number() ); // grab text in the rect that intersects itemRect diff --git a/ui/presentationwidget.cpp b/ui/presentationwidget.cpp index 93b9b7a70..526c235ee 100644 --- a/ui/presentationwidget.cpp +++ b/ui/presentationwidget.cpp @@ -1661,9 +1661,9 @@ void PresentationWidget::inhibitPowerManagement() reply.waitForFinished(); if (reply.isValid()) { m_screenInhibitCookie = reply.value(); - qDebug() << "Screen inhibition cookie" << m_screenInhibitCookie; + qCDebug(OkularUiDebug) << "Screen inhibition cookie" << m_screenInhibitCookie; } else { - qWarning() << "Unable to inhibit screensaver" << reply.error(); + qCWarning(OkularUiDebug) << "Unable to inhibit screensaver" << reply.error(); } } @@ -1683,7 +1683,7 @@ void PresentationWidget::inhibitPowerManagement() if (reply.isValid()) { m_sleepInhibitCookie = reply.value().fileDescriptor(); } else { - qWarning() << "Unable to inhibit sleep" << reply.error(); + qCWarning(OkularUiDebug) << "Unable to inhibit sleep" << reply.error(); } } #endif