Commit 9d897399 authored by Frederik Gladhorn's avatar Frederik Gladhorn
Browse files

Use categorized logging

parent 50e3c147
......@@ -96,6 +96,7 @@ set(okularcore_SRCS
core/misc.cpp
core/movie.cpp
core/observer.cpp
core/debug.cpp
core/page.cpp
core/pagecontroller.cpp
core/pagesize.cpp
......@@ -221,6 +222,7 @@ set(okularpart_SRCS
ui/annotationtools.cpp
ui/annotationwidgets.cpp
ui/bookmarklist.cpp
ui/debug_ui.cpp
ui/fileprinterpreview.cpp
ui/findbar.cpp
ui/formwidgets.cpp
......
......@@ -421,7 +421,7 @@ ObjectRect::~ObjectRect()
else if ( m_objectType == SourceRef )
delete static_cast<Okular::SourceReference*>( m_object );
else
kDebug(OkularDebug).nospace() << "Object deletion not implemented for type '" << m_objectType << "'.";
qCDebug(OkularCoreDebug).nospace() << "Object deletion not implemented for type '" << m_objectType << "'.";
}
/** class AnnotationObjectRect **/
......
......@@ -648,7 +648,7 @@ void RegularArea<NormalizedShape, Shape>::simplify()
}
}
#ifdef DEBUG_REGULARAREA
kDebug() << "from" << prev_end << "to" << this->count();
qCDebug(OkularCoreDebug) << "from" << prev_end << "to" << this->count();
#endif
}
......
......@@ -110,7 +110,7 @@ int AudioPlayerPrivate::newId() const
bool AudioPlayerPrivate::play( const SoundInfo& si )
{
kDebug() ;
qCDebug(OkularCoreDebug) ;
PlayData * data = new PlayData();
data->m_output = new Phonon::AudioOutput( Phonon::NotificationCategory );
data->m_output->setVolume( si.volume );
......@@ -124,7 +124,7 @@ bool AudioPlayerPrivate::play( const SoundInfo& si )
case Sound::External:
{
QString url = si.sound->url();
kDebug(OkularDebug) << "External," << url;
qCDebug(OkularCoreDebug) << "External," << url;
if ( !url.isEmpty() )
{
int newid = newId();
......@@ -148,10 +148,10 @@ bool AudioPlayerPrivate::play( const SoundInfo& si )
case Sound::Embedded:
{
QByteArray filedata = si.sound->data();
kDebug(OkularDebug) << "Embedded," << filedata.length();
qCDebug(OkularCoreDebug) << "Embedded," << filedata.length();
if ( !filedata.isEmpty() )
{
kDebug(OkularDebug) << "Mediaobject:" << data->m_mediaobject;
qCDebug(OkularCoreDebug) << "Mediaobject:" << data->m_mediaobject;
int newid = newId();
m_mapper.setMapping( data->m_mediaobject, newid );
data->m_buffer = new QBuffer();
......@@ -171,7 +171,7 @@ bool AudioPlayerPrivate::play( const SoundInfo& si )
if ( data )
{
QObject::connect( data->m_mediaobject, SIGNAL(finished()), &m_mapper, SLOT(map()) );
kDebug(OkularDebug) << "PLAY";
qCDebug(OkularCoreDebug) << "PLAY";
data->play();
m_state = AudioPlayer::PlayingState;
}
......@@ -205,7 +205,7 @@ void AudioPlayerPrivate::finished( int id )
m_playing.erase( it );
m_state = AudioPlayer::StoppedState;
}
kDebug(OkularDebug) << "finished," << m_playing.count();
qCDebug(OkularCoreDebug) << "finished," << m_playing.count();
}
......@@ -235,7 +235,7 @@ void AudioPlayer::playSound( const Sound * sound, const SoundAction * linksound
if ( sound->soundType() == Sound::External && !d->m_currentDocument.isLocalFile() )
return;
kDebug() ;
qCDebug(OkularCoreDebug) ;
SoundInfo si( sound, linksound );
// if the mix flag of the new sound is false, then the currently playing
......
/***************************************************************************
* Copyright (C) 2014 by Frederik Gladhorn <gladhorn@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#include "debug_p.h"
Q_LOGGING_CATEGORY(OkularCoreDebug, "org.kde.okular.core")
/***************************************************************************
* Copyright (C) 2007 by Pino Toscano <pino@kde.org> *
* Copyright (C) 2014 by Frederik Gladhorn <gladhorn@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
......@@ -7,9 +8,11 @@
* (at your option) any later version. *
***************************************************************************/
#ifndef _OKUAR_DEBUG_P_H_
#define _OKUAR_DEBUG_P_H_
#ifndef OKULAR_DEBUG_P_H
#define OKULAR_DEBUG_P_H
#define OkularDebug 4700
#include <QtCore/qloggingcategory.h>
Q_DECLARE_LOGGING_CATEGORY(OkularCoreDebug)
#endif
......@@ -358,7 +358,7 @@ void DocumentPrivate::cleanupPixmapMemory( qulonglong memoryToFree )
if ( !p ) // No pixmap to remove
break;
kDebug().nospace() << "Evicting cache pixmap observer=" << p->observer << " page=" << p->page;
qCDebug(OkularCoreDebug).nospace() << "Evicting cache pixmap observer=" << p->observer << " page=" << p->page;
// m_allocatedPixmapsTotalMemory can't underflow because we always add or remove
// the memory used by the AllocatedPixmap so at most it can reach zero
......@@ -609,7 +609,7 @@ void DocumentPrivate::loadDocumentInfo()
// note: load data and stores it internally (document or pages). observers
// are still uninitialized at this point so don't access them
{
//kDebug(OkularDebug).nospace() << "Using '" << d->m_xmlFileName << "' as document info file.";
//qCDebug(OkularCoreDebug).nospace() << "Using '" << d->m_xmlFileName << "' as document info file.";
if ( m_xmlFileName.isEmpty() )
return;
......@@ -626,7 +626,7 @@ void DocumentPrivate::loadDocumentInfo( QFile &infoFile )
QDomDocument doc( "documentInfo" );
if ( !doc.setContent( &infoFile ) )
{
kDebug(OkularDebug) << "Can't load XML pair! Check for broken xml.";
qCDebug(OkularCoreDebug) << "Can't load XML pair! Check for broken xml.";
infoFile.close();
return;
}
......@@ -807,7 +807,7 @@ bool DocumentPrivate::openRelativeFile( const QString & fileName )
if ( absFileName.isEmpty() )
return false;
kDebug(OkularDebug).nospace() << "openDocument: '" << absFileName << "'";
qCDebug(OkularCoreDebug).nospace() << "openDocument: '" << absFileName << "'";
emit m_parent->openUrl( absFileName );
return true;
......@@ -818,7 +818,7 @@ Generator * DocumentPrivate::loadGeneratorLibrary( const KService::Ptr &service
KPluginFactory *factory = KPluginLoader( service->library() ).factory();
if ( !factory )
{
kWarning(OkularDebug).nospace() << "Invalid plugin factory for " << service->library() << "!";
kWarning(OkularCoreDebug).nospace() << "Invalid plugin factory for " << service->library() << "!";
return 0;
}
......@@ -946,7 +946,7 @@ Document::OpenResult DocumentPrivate::openDocumentInternal( const KService::Ptr&
QApplication::setOverrideCursor( Qt::WaitCursor );
const QSizeF dpi = Utils::realDpi(m_widget);
kDebug() << "Output DPI:" << dpi;
qCDebug(OkularCoreDebug) << "Output DPI:" << dpi;
m_generator->setDPI(dpi);
Document::OpenResult openResult = Document::OpenError;
......@@ -1171,7 +1171,7 @@ void DocumentPrivate::performModifyPageAnnotation( int page, Annotation * annota
}
// Redraw everything, including ExternallyDrawn annotations
kDebug(OkularDebug) << "Refreshing Pixmaps";
qCDebug(OkularCoreDebug) << "Refreshing Pixmaps";
refreshPixmaps( page );
}
......@@ -1360,7 +1360,7 @@ void DocumentPrivate::sendGeneratorPixmapRequest()
else if ( !r->d->mForce && r->preload() && qAbs( r->pageNumber() - currentViewportPage ) >= maxDistance )
{
m_pixmapRequestsStack.pop_back();
//kDebug() << "Ignoring request that doesn't fit in cache";
//qCDebug(OkularCoreDebug) << "Ignoring request that doesn't fit in cache";
delete r;
}
// Ignore requests for pixmaps that are already being generated
......@@ -1373,7 +1373,7 @@ void DocumentPrivate::sendGeneratorPixmapRequest()
else if ( !tilesManager && m_generator->hasFeature( Generator::TiledRendering ) && (long)r->width() * (long)r->height() > 8000000L )
{
// if the image is too big. start using tiles
kDebug(OkularDebug).nospace() << "Start using tiles on page " << r->pageNumber()
qCDebug(OkularCoreDebug).nospace() << "Start using tiles on page " << r->pageNumber()
<< " (" << r->width() << "x" << r->height() << " px);";
// fill the tiles manager with the last rendered pixmap
......@@ -1428,7 +1428,7 @@ void DocumentPrivate::sendGeneratorPixmapRequest()
// If the requested area is below 6000000 pixels, switch off the tile manager
else if ( tilesManager && (long)r->width() * (long)r->height() < 6000000L )
{
kDebug(OkularDebug).nospace() << "Stop using tiles on page " << r->pageNumber()
qCDebug(OkularCoreDebug).nospace() << "Stop using tiles on page " << r->pageNumber()
<< " (" << r->width() << "x" << r->height() << " px);";
// page is too small. stop using tiles.
......@@ -1442,9 +1442,9 @@ void DocumentPrivate::sendGeneratorPixmapRequest()
m_pixmapRequestsStack.pop_back();
if ( !m_warnedOutOfMemory )
{
kWarning(OkularDebug).nospace() << "Running out of memory on page " << r->pageNumber()
kWarning(OkularCoreDebug).nospace() << "Running out of memory on page " << r->pageNumber()
<< " (" << r->width() << "x" << r->height() << " px);";
kWarning(OkularDebug) << "this message will be reported only once.";
kWarning(OkularCoreDebug) << "this message will be reported only once.";
m_warnedOutOfMemory = true;
}
delete r;
......@@ -1477,7 +1477,7 @@ void DocumentPrivate::sendGeneratorPixmapRequest()
if ( m_generator->canGeneratePixmap() )
{
QRect requestRect = !request->isTile() ? QRect(0, 0, request->width(), request->height() ) : request->normalizedRect().geometry( request->width(), request->height() );
kDebug(OkularDebug).nospace() << "sending request observer=" << request->observer() << " " <<requestRect.width() << "x" << requestRect.height() << "@" << request->pageNumber() << " async == " << request->asynchronous() << " isTile == " << request->isTile();
qCDebug(OkularCoreDebug).nospace() << "sending request observer=" << request->observer() << " " <<requestRect.width() << "x" << requestRect.height() << "@" << request->pageNumber() << " async == " << request->asynchronous() << " isTile == " << request->isTile();
m_pixmapRequestsStack.removeAll ( request );
if ( tm )
......@@ -2209,7 +2209,7 @@ Document::OpenResult Document::openDocument( const QString & docFile, const KUrl
if (offers.isEmpty())
{
emit error( i18n( "Can not find a plugin which is able to handle the document being passed." ), -1 );
kWarning(OkularDebug).nospace() << "No plugin for mimetype '" << mime.name() << "'.";
kWarning(OkularCoreDebug).nospace() << "No plugin for mimetype '" << mime.name() << "'.";
return OpenError;
}
int hRank=0;
......@@ -2915,7 +2915,7 @@ void Document::requestPixmaps( const QLinkedList< PixmapRequest * > & requests,
{
// set the 'page field' (see PixmapRequest) and check if it is valid
PixmapRequest * request = *rIt;
kDebug(OkularDebug).nospace() << "request observer=" << request->observer() << " " <<request->width() << "x" << request->height() << "@" << request->pageNumber();
qCDebug(OkularCoreDebug).nospace() << "request observer=" << request->observer() << " " <<request->width() << "x" << request->height() << "@" << request->pageNumber();
if ( d->m_pagesVector.value( request->pageNumber() ) == 0 )
{
// skip requests referencing an invalid page (must not happen)
......@@ -3037,7 +3037,7 @@ void Document::prepareToModifyAnnotationProperties( Annotation * annotation )
Q_ASSERT(d->m_prevPropsOfAnnotBeingModified.isNull());
if (!d->m_prevPropsOfAnnotBeingModified.isNull())
{
kError(OkularDebug) << "Error: Document::prepareToModifyAnnotationProperties has already been called since last call to Document::modifyPageAnnotationProperties";
kError(OkularCoreDebug) << "Error: Document::prepareToModifyAnnotationProperties has already been called since last call to Document::modifyPageAnnotationProperties";
return;
}
d->m_prevPropsOfAnnotBeingModified = annotation->getAnnotationPropertiesDomNode();
......@@ -3048,7 +3048,7 @@ void Document::modifyPageAnnotationProperties( int page, Annotation * annotation
Q_ASSERT(!d->m_prevPropsOfAnnotBeingModified.isNull());
if (d->m_prevPropsOfAnnotBeingModified.isNull())
{
kError(OkularDebug) << "Error: Document::prepareToModifyAnnotationProperties must be called before Annotation is modified";
kError(OkularCoreDebug) << "Error: Document::prepareToModifyAnnotationProperties must be called before Annotation is modified";
return;
}
QDomNode prevProps = d->m_prevPropsOfAnnotBeingModified;
......@@ -3210,12 +3210,12 @@ void Document::setViewport( const DocumentViewport & viewport, DocumentObserver
{
if ( !viewport.isValid() )
{
kDebug(OkularDebug) << "invalid viewport:" << viewport.toString();
qCDebug(OkularCoreDebug) << "invalid viewport:" << viewport.toString();
return;
}
if ( viewport.pageNumber >= int(d->m_pagesVector.count()) )
{
//kDebug(OkularDebug) << "viewport out of document:" << viewport.toString();
//qCDebug(OkularCoreDebug) << "viewport out of document:" << viewport.toString();
return;
}
......@@ -3223,7 +3223,7 @@ void Document::setViewport( const DocumentViewport & viewport, DocumentObserver
DocumentViewport & oldViewport = *d->m_viewportIterator;
// disabled by enrico on 2005-03-18 (less debug output)
//if ( viewport == oldViewport )
// kDebug(OkularDebug) << "setViewport with the same viewport.";
// qCDebug(OkularCoreDebug) << "setViewport with the same viewport.";
const int oldPageNumber = oldViewport.pageNumber;
......@@ -3631,7 +3631,7 @@ void Document::processAction( const Action * action )
// first open filename if link is pointing outside this document
if ( go->isExternal() && !d->openRelativeFile( go->fileName() ) )
{
kWarning(OkularDebug).nospace() << "Action: Error opening '" << go->fileName() << "'.";
kWarning(OkularCoreDebug).nospace() << "Action: Error opening '" << go->fileName() << "'.";
return;
}
else
......@@ -3820,14 +3820,14 @@ void Document::processSourceReference( const SourceReference * ref )
const KUrl url( d->giveAbsolutePath( ref->fileName() ) );
if ( !url.isLocalFile() )
{
kDebug(OkularDebug) << url.url() << "is not a local file.";
qCDebug(OkularCoreDebug) << url.url() << "is not a local file.";
return;
}
const QString absFileName = url.toLocalFile();
if ( !QFile::exists( absFileName ) )
{
kDebug(OkularDebug) << "No such file:" << absFileName;
qCDebug(OkularCoreDebug) << "No such file:" << absFileName;
return;
}
......@@ -4293,8 +4293,8 @@ bool Document::saveDocumentArchive( const QString &fileName )
}
else
{
kWarning(OkularDebug) << "saveChanges failed: " << errorText;
kDebug(OkularDebug) << "Falling back to saving a copy of the original file";
kWarning(OkularCoreDebug) << "saveChanges failed: " << errorText;
qCDebug(OkularCoreDebug) << "Falling back to saving a copy of the original file";
}
}
......@@ -4369,7 +4369,7 @@ void DocumentPrivate::requestDone( PixmapRequest * req )
#ifndef NDEBUG
if ( !m_generator->canGeneratePixmap() )
kDebug(OkularDebug) << "requestDone with generator not in READY state.";
qCDebug(OkularCoreDebug) << "requestDone with generator not in READY state.";
#endif
// [MEM] 1.1 find and remove a previous entry for the same page and id
......@@ -4405,7 +4405,7 @@ void DocumentPrivate::requestDone( PixmapRequest * req )
}
#ifndef NDEBUG
else
kWarning(OkularDebug) << "Receiving a done request for the defunct observer" << observer;
kWarning(OkularCoreDebug) << "Receiving a done request for the defunct observer" << observer;
#endif
// 3. delete request
......@@ -4512,7 +4512,7 @@ void DocumentPrivate::setRotationInternal( int r, bool notify )
foreachObserverD( notifySetup( m_pagesVector, DocumentObserver::NewLayoutForPages ) );
foreachObserverD( notifyContentsCleared( DocumentObserver::Pixmap | DocumentObserver::Highlights | DocumentObserver::Annotations ) );
}
kDebug(OkularDebug) << "Rotated:" << r;
qCDebug(OkularCoreDebug) << "Rotated:" << r;
}
void Document::setPageSize( const PageSize &size )
......@@ -4542,7 +4542,7 @@ void Document::setPageSize( const PageSize &size )
foreachObserver( notifySetup( d->m_pagesVector, DocumentObserver::NewLayoutForPages ) );
foreachObserver( notifyContentsCleared( DocumentObserver::Pixmap | DocumentObserver::Highlights ) );
kDebug(OkularDebug) << "New PageSize id:" << sizeid;
qCDebug(OkularCoreDebug) << "New PageSize id:" << sizeid;
}
......
......@@ -229,33 +229,33 @@ EditTextCommand::EditTextCommand( const QString & newContents,
// If There was a selection then edit was not a simple single character backspace, delete, or insert
if (m_prevCursorPos != m_prevAnchorPos)
{
kDebug(OkularDebug) << "OtherEdit, selection";
qCDebug(OkularCoreDebug) << "OtherEdit, selection";
m_editType = OtherEdit;
}
else if ( newContentsRightOfCursor() == oldContentsRightOfCursor() &&
newContentsLeftOfCursor() == oldContentsLeftOfCursor().left(oldContentsLeftOfCursor().length() - 1) &&
oldContentsLeftOfCursor().right(1) != "\n" )
{
kDebug(OkularDebug) << "CharBackspace";
qCDebug(OkularCoreDebug) << "CharBackspace";
m_editType = CharBackspace;
}
else if ( newContentsLeftOfCursor() == oldContentsLeftOfCursor() &&
newContentsRightOfCursor() == oldContentsRightOfCursor().right(oldContentsRightOfCursor().length() - 1) &&
oldContentsRightOfCursor().left(1) != "\n" )
{
kDebug(OkularDebug) << "CharDelete";
qCDebug(OkularCoreDebug) << "CharDelete";
m_editType = CharDelete;
}
else if ( newContentsRightOfCursor() == oldContentsRightOfCursor() &&
newContentsLeftOfCursor().left( newContentsLeftOfCursor().length() - 1) == oldContentsLeftOfCursor() &&
newContentsLeftOfCursor().right(1) != "\n" )
{
kDebug(OkularDebug) << "CharInsert";
qCDebug(OkularCoreDebug) << "CharInsert";
m_editType = CharInsert;
}
else
{
kDebug(OkularDebug) << "OtherEdit";
qCDebug(OkularCoreDebug) << "OtherEdit";
m_editType = OtherEdit;
}
}
......
......@@ -96,14 +96,14 @@ int FilePrinter::doPrintFiles( QPrinter &printer, QStringList fileList, FileDele
} else if ( inputFileInfo.suffix() == "ps" && printer.outputFormat() == QPrinter::PdfFormat && ps2pdfAvailable() ) {
exe = "ps2pdf";
argList << fileList[0] << printer.outputFileName();
kDebug(OkularDebug) << "Executing" << exe << "with arguments" << argList;
qCDebug(OkularCoreDebug) << "Executing" << exe << "with arguments" << argList;
ret = KProcess::execute( exe, argList );
#pragma message("KF5: Fix PostScript printing")
// } else if ( inputFileInfo.suffix() == "pdf" && printer.outputFormat() == QPrinter::PostScriptFormat && pdf2psAvailable() ) {
// exe = "pdf2ps";
// argList << fileList[0] << printer.outputFileName();
// kDebug(OkularDebug) << "Executing" << exe << "with arguments" << argList;
// qCDebug(OkularCoreDebug) << "Executing" << exe << "with arguments" << argList;
// ret = KProcess::execute( exe, argList );
} else {
ret = -5;
......@@ -135,7 +135,7 @@ int FilePrinter::doPrintFiles( QPrinter &printer, QStringList fileList, FileDele
bool useCupsOptions = cupsAvailable();
argList = printArguments( printer, fileDeletePolicy, pageSelectPolicy,
useCupsOptions, pageRange, exe, documentOrientation ) << fileList;
kDebug(OkularDebug) << "Executing" << exe << "with arguments" << argList;
qCDebug(OkularCoreDebug) << "Executing" << exe << "with arguments" << argList;
ret = KProcess::execute( exe, argList );
......
......@@ -48,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(OkularDebug) << "changing direction in selection";
qCDebug(OkularCoreDebug) << "changing direction in selection";
d->cur[1] = p;
}
......
......@@ -67,7 +67,7 @@ Movie::Movie( const QString& fileName, const QByteArray &data )
d->m_tmp->write( data );
d->m_tmp->flush();
}
else kDebug(OkularDebug) << "Failed to create temporary file for video data.";
else qCDebug(OkularCoreDebug) << "Failed to create temporary file for video data.";
}
Movie::~Movie()
......
......@@ -667,7 +667,7 @@ bool Page::removeAnnotation( Annotation * annotation )
it = m_rects.erase( it );
rectfound = true;
}
kDebug(OkularDebug) << "removed annotation:" << annotation->uniqueName();
qCDebug(OkularCoreDebug) << "removed annotation:" << annotation->uniqueName();
annotation->d_ptr->m_page = 0;
m_annotations.erase( aIt );
break;
......@@ -820,13 +820,13 @@ void PagePrivate::restoreLocalContents( const QDomNode & pageNode )
if ( annotation )
{
m_doc->performAddPageAnnotation(m_number, annotation);
kDebug(OkularDebug) << "restored annot:" << annotation->uniqueName();
qCDebug(OkularCoreDebug) << "restored annot:" << annotation->uniqueName();
}
else
kWarning(OkularDebug).nospace() << "page (" << m_number << "): can't restore an annotation from XML.";
kWarning(OkularCoreDebug).nospace() << "page (" << m_number << "): can't restore an annotation from XML.";
}
#ifdef PAGE_PROFILE
kDebug(OkularDebug).nospace() << "annots: XML Load time: " << time.elapsed() << "ms";
qCDebug(OkularCoreDebug).nospace() << "annots: XML Load time: " << time.elapsed() << "ms";
#endif
}
// parse formList child element
......@@ -917,7 +917,7 @@ void PagePrivate::saveLocalContents( QDomNode & parentNode, QDomDocument & docum
QDomElement annElement = document.createElement( "annotation" );
AnnotationUtils::storeAnnotation( a, annElement, document );
annotListElement.appendChild( annElement );
kDebug(OkularDebug) << "save annotation:" << a->uniqueName();
qCDebug(OkularCoreDebug) << "save annotation:" << a->uniqueName();
}
}
......
......@@ -94,7 +94,7 @@ void ExecutorKJS::execute( const QString &script )
int errLine;
if ( !KJSInterpreter::normalizeCode( script, &script2, &errLine, &errMsg ) )
{
kWarning(OkularDebug) << "Parse error during normalization!";
kWarning(OkularCoreDebug) << "Parse error during normalization!";
script2 = script;
}
#endif
......@@ -104,10 +104,10 @@ void ExecutorKJS::execute( const QString &script )
KJSContext* ctx = d->m_interpreter->globalContext();
if ( result.isException() || ctx->hasException() )
{
kDebug(OkularDebug) << "JS exception" << result.errorMessage();
qCDebug(OkularCoreDebug) << "JS exception" << result.errorMessage();
}
else
{
kDebug(OkularDebug) << "result:" << result.value().toString( ctx );
qCDebug(OkularCoreDebug) << "result:" << result.value().toString( ctx );
}
}
......@@ -97,7 +97,7 @@ static void clearConsole()
static void outputToConsole( const QString &cMessage )
{
kDebug(OkularDebug) << "CONSOLE:" << cMessage;
qCDebug(OkularCoreDebug) << "CONSOLE:" << cMessage;
}
#endif /* OKULAR_JS_CONSOLE */
......
......@@ -62,7 +62,7 @@ static void fieldSetReadOnly( KJSContext *context, void *object, KJSObject value
Q_UNUSED( context );
Q_UNUSED( object );
Q_UNUSED( value );
kDebug(OkularDebug) << "Not implemented: setting readonly property";
qCDebug(OkularCoreDebug) << "Not implemented: setting readonly property";
#endif
}
......@@ -123,7 +123,7 @@ static KJSObject fieldGetValue( KJSContext *context, void *object )
value = g_fieldCache->value( field );
else
value = KJSString("");
kDebug(OkularDebug) << "Getting the value of a readonly field" << field->name() << ":" << value.toString( context );
qCDebug(OkularCoreDebug) << "Getting the value of a readonly field" << field->name() << ":" << value.toString( context );
return value;
}
......@@ -163,7 +163,7 @@ static void fieldSetValue( KJSContext *context, void *object, KJSObject value )
if ( field->isReadOnly() )
{
// ### throw exception?
kDebug(OkularDebug) << "Trying to change the readonly field" << field->name() << "to" << value.toString( context );
qCDebug(OkularCoreDebug) << "Trying to change the readonly field" << field->name() << "to" << value.toString( context );
g_fieldCache->insert( field, value );
return;
}
......
......@@ -45,7 +45,7 @@ Scripter::~Scripter()
QString Scripter::execute( ScriptType type, const QString &script )
{
kDebug(OkularDebug) << "executing the script:";
qCDebug(OkularCoreDebug) << "executing the script:";
#if 0
if ( script.length() < 1000 )
qDebug() << script;
......
......@@ -879,7 +879,7 @@ RegularAreaRect* TextPagePrivate::findTextInternalForward( int searchID, const Q
int min=qMin(queryLeft,len-offset);
{
#ifdef DEBUG_TEXTPAGE
kDebug(OkularDebug) << str.midRef(offset, min) << ":" << _query.midRef(j, min);
qCDebug(OkularCoreDebug) << str.midRef(offset, min) << ":" << _query.midRef(j, min);
#endif
// we have equal (or less than) area of the query left as the length of the current
// entity
......@@ -891,7 +891,7 @@ RegularAreaRect* TextPagePrivate::findTextInternalForward( int searchID, const Q
// we need to get back to query start
// and continue the search from this place
#ifdef DEBUG_TEXTPAGE
kDebug(OkularDebug) << "\tnot matched";
qCDebug(OkularCoreDebug) << "\tnot matched";
#endif
j = 0;
queryLeft=query.length();
......@@ -908,7 +908,7 @@ RegularAreaRect* TextPagePrivate::findTextInternalForward( int searchID, const Q
// subtract the length of the current entity from
// the left length of the query
#ifdef DEBUG_TEXTPAGE
kDebug(OkularDebug) << "\tmatched";
qCDebug(OkularCoreDebug) << "\tmatched";
#endif
j += min;
queryLeft -= min;
......@@ -995,7 +995,7 @@ RegularAreaRect* TextPagePrivate::findTextInternalBackward( int searchID, const
int min=qMin(queryLeft,offset);
{
#ifdef DEBUG_TEXTPAGE
kDebug(OkularDebug) << str.midRef(offset-min, min) << " : " << _query.midRef(j-min, min);
qCDebug(OkularCoreDebug) << str.midRef(offset-min, min) << " : " << _query.midRef(j-min, min);
#endif
// we have equal (or less than) area of the query left as the length of the current
// entity
......@@ -1008,7 +1008,7 @@ RegularAreaRect* TextPagePrivate::findTextInternalBackward( int searchID, const
// we need to get back to query start
// and continue the search from this place
#ifdef DEBUG_TEXTPAGE
kDebug(OkularDebug) << "\tnot matched";
qCDebug(OkularCoreDebug) << "\tnot matched";
#endif
j = query.length();
......@@ -1026,7 +1026,7 @@ RegularAreaRect* TextPagePrivate::findTextInternalBackward( int searchID, const
// subtract the length of the current entity from
// the left length of the query
#ifdef DEBUG_TEXTPAGE
kDebug(OkularDebug) << "\tmatched";
qCDebug(OkularCoreDebug) << "\tmatched";
#endif
j -= min;
queryLeft -= min;
......
......@@ -78,7 +78,7 @@ double Utils::realDpiX()
{
const QDesktopWidget* w = QApplication::desktop();
if (w->width() > 0 && w->widthMM() > 0) {
kDebug() << "Pix:" << w->width() << "MM:" << w->widthMM();
qCDebug(OkularCoreDebug) << "Pix:" << w->width() << "MM:" << w->widthMM();