diff --git a/core/area.cpp b/core/area.cpp index b4c342150..f29cf7fda 100644 --- a/core/area.cpp +++ b/core/area.cpp @@ -18,6 +18,7 @@ #include "action.h" #include "annotations.h" #include "annotations_p.h" +#include "debug_p.h" #include "sourcereference.h" using namespace Okular; @@ -286,7 +287,7 @@ ObjectRect::~ObjectRect() else if ( m_objectType == SourceRef ) delete static_cast( m_object ); else - kDebug().nospace() << "Object deletion not implemented for type '" << m_objectType << "' ."; + kDebug(OkularDebug).nospace() << "Object deletion not implemented for type '" << m_objectType << "'."; } /** class AnnotationObjectRect **/ diff --git a/core/audioplayer.cpp b/core/audioplayer.cpp index 61d1c4442..d1d841c76 100644 --- a/core/audioplayer.cpp +++ b/core/audioplayer.cpp @@ -22,6 +22,7 @@ // local includes #include "action.h" +#include "debug_p.h" #include "sound.h" using namespace Okular; @@ -123,7 +124,7 @@ bool AudioPlayerPrivate::play( const SoundInfo& si ) case Sound::External: { QString url = si.sound->url(); - kDebug() << "External," << url; + kDebug(OkularDebug) << "External," << url; if ( !url.isEmpty() ) { int newid = newId(); @@ -147,10 +148,10 @@ bool AudioPlayerPrivate::play( const SoundInfo& si ) case Sound::Embedded: { QByteArray filedata = si.sound->data(); - kDebug() << "Embedded," << filedata.length(); + kDebug(OkularDebug) << "Embedded," << filedata.length(); if ( !filedata.isEmpty() ) { - kDebug() << "Mediaobject:" << data->m_mediaobject; + kDebug(OkularDebug) << "Mediaobject:" << data->m_mediaobject; int newid = newId(); m_mapper.setMapping( data->m_mediaobject, newid ); data->m_buffer = new QBuffer(); @@ -170,7 +171,7 @@ bool AudioPlayerPrivate::play( const SoundInfo& si ) if ( data ) { QObject::connect( data->m_mediaobject, SIGNAL( finished() ), &m_mapper, SLOT( map() ) ); - kDebug() << "PLAY"; + kDebug(OkularDebug) << "PLAY"; data->play(); } return valid; @@ -200,7 +201,7 @@ void AudioPlayerPrivate::finished( int id ) delete it.value(); m_playing.erase( it ); } - kDebug() << "finished," << m_playing.count(); + kDebug(OkularDebug) << "finished," << m_playing.count(); } diff --git a/core/fileprinter.cpp b/core/fileprinter.cpp index 52334da1a..5ba0354b8 100644 --- a/core/fileprinter.cpp +++ b/core/fileprinter.cpp @@ -28,6 +28,7 @@ #include #include +#include "debug_p.h" using namespace Okular; @@ -91,7 +92,7 @@ int FilePrinter::doPrintFiles( QPrinter &printer, QStringList fileList, FileDele bool useCupsOptions = cupsAvailable(); QStringList argList = printArguments( printer, fileDeletePolicy, pageSelectPolicy, useCupsOptions, pageRange, exe ) << fileList; - kDebug() << "Executing " << exe << " with arguments" << argList; + kDebug(OkularDebug) << "Executing" << exe << "with arguments" << argList; int ret = KProcess::execute( exe, argList ); @@ -102,7 +103,7 @@ int FilePrinter::doPrintFiles( QPrinter &printer, QStringList fileList, FileDele argList = printArguments( printer, fileDeletePolicy, pageSelectPolicy, useCupsOptions, pageRange, exe ) << fileList; - kDebug() << "Retrying " << exe << " without cups arguments" << argList; + kDebug(OkularDebug) << "Retrying" << exe << "without CUPS arguments" << argList; ret = KProcess::execute( exe, argList ); } @@ -192,9 +193,9 @@ bool FilePrinter::detectCupsService() // original license LGPL KLocalSocket sock; sock.connectToPath("/ipp"); - kDebug() << "socket wait = " << sock.waitForConnected(); - kDebug() << "socket error = " << sock.error(); - kDebug() << "socket isOpen() = " << sock.isOpen(); + kDebug(OkularDebug) << "socket wait =" << sock.waitForConnected(); + kDebug(OkularDebug) << "socket error =" << sock.error(); + kDebug(OkularDebug) << "socket isOpen() =" << sock.isOpen(); return sock.isOpen(); } diff --git a/core/misc.cpp b/core/misc.cpp index 479587db9..34812c4f8 100644 --- a/core/misc.cpp +++ b/core/misc.cpp @@ -11,6 +11,8 @@ #include +#include "debug_p.h" + using namespace Okular; class TextSelection::Private @@ -46,7 +48,7 @@ void TextSelection::end( const NormalizedPoint & p ) int dir1 = d->direction; d->direction = (p.y - d->cur[0].y < 0 || (p.y - d->cur[0].y == 0 && p.x - d->cur[0].x < 0)); if (d->direction != dir1) - kDebug() << "changing direction in selection"; + kDebug(OkularDebug) << "changing direction in selection"; d->cur[1] = p; } diff --git a/core/page.cpp b/core/page.cpp index 702138814..64de140d0 100644 --- a/core/page.cpp +++ b/core/page.cpp @@ -25,6 +25,7 @@ #include "annotations.h" #include "annotations_p.h" #include "area.h" +#include "debug_p.h" #include "form.h" #include "form_p.h" #include "pagecontroller_p.h" @@ -484,7 +485,7 @@ void Page::addAnnotation( Annotation * annotation ) QString uniqueName = "okular-"; uniqueName += ( QString::number(d->m_number) + '-' + QString::number(++(d->m_maxuniqueNum)) ); - kDebug().nospace() << "inc m_maxuniqueNum=" << d->m_maxuniqueNum; + kDebug(OkularDebug).nospace() << "inc m_maxuniqueNum=" << d->m_maxuniqueNum; annotation->setUniqueName( uniqueName ); } @@ -548,7 +549,7 @@ bool Page::removeAnnotation( Annotation * annotation ) it = m_rects.erase( it ); rectfound = true; } - kDebug() << "removed annotation:" << annotation->uniqueName(); + kDebug(OkularDebug) << "removed annotation:" << annotation->uniqueName(); delete *aIt; m_annotations.erase( aIt ); break; @@ -696,13 +697,13 @@ void PagePrivate::restoreLocalContents( const QDomNode & pageNode ) m_maxuniqueNum = uniqID; } - kDebug() << "restored annot:" << annotation->uniqueName(); + kDebug(OkularDebug) << "restored annot:" << annotation->uniqueName(); } else - kWarning().nospace() << "page (" << m_number << "): can't restore an annotation from XML."; + kWarning(OkularDebug).nospace() << "page (" << m_number << "): can't restore an annotation from XML."; } #ifdef PAGE_PROFILE - kDebug().nospace() << "annots: XML Load time: " << time.elapsed() << "ms"; + kDebug(OkularDebug).nospace() << "annots: XML Load time: " << time.elapsed() << "ms"; #endif } // parse formList child element @@ -787,7 +788,7 @@ void PagePrivate::saveLocalContents( QDomNode & parentNode, QDomDocument & docum QDomElement annElement = document.createElement( "annotation" ); AnnotationUtils::storeAnnotation( a, annElement, document ); annotListElement.appendChild( annElement ); - kDebug() << "save annotation:" << a->uniqueName(); + kDebug(OkularDebug) << "save annotation:" << a->uniqueName(); } }