Commit 5150419e authored by Pino Toscano's avatar Pino Toscano

adapt the debug stuff to the new kdebug way:

- make the output looking more or less like before (using nospace() or removing the spaces)
- remove endl and '\n' at the end of debug outputs
- fixing the QDebug operator<<'s around
- isolate the debug area number of the core into a separate header, and apply it instead of the numbers found in textpage.cpp

svn path=/trunk/KDE/kdegraphics/okular/; revision=694667
parent 9b92fa1d
......@@ -46,8 +46,8 @@ void NormalizedPoint::transform( const QMatrix &matrix )
QDebug operator<<( QDebug str, const Okular::NormalizedPoint& p )
{
str << "NormPt(" << p.x << "," << p.y << ")";
return str;
str.nospace() << "NormPt(" << p.x << "," << p.y << ")";
return str.space();
}
/** class NormalizedRect **/
......@@ -169,8 +169,8 @@ void NormalizedRect::transform( const QMatrix &matrix )
QDebug operator<<( QDebug str, const Okular::NormalizedRect& r )
{
str << "NormRect(" << r.left << "," << r.top << " x " << ( r.right - r.left ) << "+" << ( r.bottom - r.top ) << ")";
return str;
str.nospace() << "NormRect(" << r.left << "," << r.top << " x " << ( r.right - r.left ) << "+" << ( r.bottom - r.top ) << ")";
return str.space();
}
RegularAreaRect::RegularAreaRect()
......@@ -286,7 +286,7 @@ ObjectRect::~ObjectRect()
else if ( m_objectType == SourceRef )
delete static_cast<Okular::SourceReference*>( m_object );
else
kDebug() << "Object deletion not implemented for type '" << m_objectType << "' ." << endl;
kDebug().nospace() << "Object deletion not implemented for type '" << m_objectType << "' .";
}
/** class AnnotationObjectRect **/
......
......@@ -523,7 +523,7 @@ void RegularArea<NormalizedShape, Shape>::simplify()
}
}
#ifdef DEBUG_REGULARAREA
kDebug() << "from " << prev_end << " to " << this->count() << endl;
kDebug() << "from" << prev_end << "to" << this->count();
#endif
}
......
......@@ -111,7 +111,7 @@ int AudioPlayerPrivate::newId() const
bool AudioPlayerPrivate::play( const SoundInfo& si )
{
kDebug() << k_funcinfo << endl;
kDebug() << k_funcinfo;
PlayData * data = new PlayData();
data->m_output = new Phonon::AudioOutput( Phonon::NotificationCategory );
data->m_output->setVolume( si.volume );
......@@ -126,7 +126,7 @@ bool AudioPlayerPrivate::play( const SoundInfo& si )
case Sound::External:
{
QString url = si.sound->url();
kDebug() << "[AudioPlayer::Playinfo::play()] External, " << url << endl;
kDebug() << "[AudioPlayer::Playinfo::play()] External," << url;
if ( !url.isEmpty() )
{
if ( data->m_mediaobject->addAudioPath( data->m_path ) )
......@@ -146,7 +146,7 @@ bool AudioPlayerPrivate::play( const SoundInfo& si )
data->m_mediaobject->setCurrentSource( newurl );
m_playing.insert( newid, data );
valid = true;
kDebug() << "[AudioPlayer::Playinfo::play()] PLAY url" << endl;
kDebug() << "[AudioPlayer::Playinfo::play()] PLAY url";
}
}
break;
......@@ -155,10 +155,10 @@ bool AudioPlayerPrivate::play( const SoundInfo& si )
{
#if 0 // disable because of broken bytestream in xine :(
QByteArray filedata = si.sound->data();
kDebug() << "[AudioPlayer::Playinfo::play()] Embedded, " << filedata.length() << endl;
kDebug() << "[AudioPlayer::Playinfo::play()] Embedded," << filedata.length();
if ( !filedata.isEmpty() )
{
kDebug() << "[AudioPlayer::Playinfo::play()] mediaobject: " << data->m_mediaobject << endl;
kDebug() << "[AudioPlayer::Playinfo::play()] mediaobject:" << data->m_mediaobject;
if ( data->m_mediaobject->addAudioPath( data->m_path ) )
{
int newid = newId();
......@@ -168,7 +168,7 @@ bool AudioPlayerPrivate::play( const SoundInfo& si )
data->m_mediaobject->setCurrentSource( Phonon::MediaSource( data->m_buffer ) );
m_playing.insert( newid, data );
valid = true;
kDebug() << "[AudioPlayer::Playinfo::play()] PLAY data" << endl;
kDebug() << "[AudioPlayer::Playinfo::play()] PLAY data";
}
}
#endif
......@@ -212,7 +212,7 @@ void AudioPlayerPrivate::finished( int id )
delete it.value();
m_playing.erase( it );
}
kDebug() << k_funcinfo << "finished, " << m_playing.count() << endl;
kDebug() << k_funcinfo << "finished," << m_playing.count();
}
......@@ -242,7 +242,7 @@ void AudioPlayer::playSound( const Sound * sound, const SoundAction * linksound
if ( sound->soundType() == Sound::External && !d->m_currentDocument.isLocalFile() )
return;
kDebug() << k_funcinfo << endl;
kDebug() << k_funcinfo;
SoundInfo si( sound, linksound );
// if the mix flag of the new sound is false, then the currently playing
......
/***************************************************************************
* Copyright (C) 2007 by Pino Toscano <pino@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. *
***************************************************************************/
#ifndef _OKUAR_DEBUG_P_H_
#define _OKUAR_DEBUG_P_H_
#define OkularDebug 4650
#endif
......@@ -46,6 +46,7 @@
#include "audioplayer_p.h"
#include "bookmarkmanager.h"
#include "chooseenginedialog_p.h"
#include "debug_p.h"
#include "generator.h"
#include "generator_p.h"
#include "interfaces/configinterface.h"
......@@ -66,8 +67,6 @@
using namespace Okular;
static int OkularDebug = 4650;
struct AllocatedPixmap
{
// owner of the page
......@@ -402,7 +401,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) << "Using '" << d->m_xmlFileName << "' as document info file." << endl;
//kDebug(OkularDebug).nospace() << "Using '" << d->m_xmlFileName << "' as document info file.";
if ( m_xmlFileName.isEmpty() )
return;
......@@ -414,7 +413,7 @@ void DocumentPrivate::loadDocumentInfo()
QDomDocument doc( "documentInfo" );
if ( !doc.setContent( &infoFile ) )
{
kDebug(OkularDebug) << "Can't load XML pair! Check for broken xml." << endl;
kDebug(OkularDebug) << "Can't load XML pair! Check for broken xml.";
infoFile.close();
return;
}
......@@ -506,7 +505,7 @@ bool DocumentPrivate::openRelativeFile( const QString & fileName )
if ( absFileName.isEmpty() )
return false;
kDebug(OkularDebug) << "openDocument: '" << absFileName << "'" << endl;
kDebug(OkularDebug).nospace() << "openDocument: '" << absFileName << "'";
emit m_parent->openUrl( absFileName );
return true;
......@@ -517,8 +516,8 @@ Generator * DocumentPrivate::loadGeneratorLibrary( const QString& name, const QS
KLibrary *lib = KLibLoader::self()->library( QFile::encodeName( libname ), QLibrary::ExportExternalSymbolsHint );
if ( !lib )
{
kWarning() << "Could not load '" << libname << "' library." << endl;
kWarning() << KLibLoader::self()->lastErrorMessage() << endl;
kWarning().nospace() << "Could not load '" << libname << "' library.";
kWarning() << KLibLoader::self()->lastErrorMessage();
emit m_parent->error( i18n( "Could not load the necessary plugin to view the document" ), -1 );
return 0;
}
......@@ -526,13 +525,13 @@ Generator * DocumentPrivate::loadGeneratorLibrary( const QString& name, const QS
Generator* (*create_plugin)() = ( Generator* (*)() ) lib->resolveFunction( "create_plugin" );
if ( !create_plugin )
{
kWarning(OkularDebug) << "Broken generator " << libname << ": missing create_plugin()!" << endl;
kWarning(OkularDebug).nospace() << "Broken generator " << libname << ": missing create_plugin()!";
return 0;
}
Generator * generator = create_plugin();
if ( !generator )
{
kWarning() << "Broken generator " << libname << "!" << endl;
kWarning().nospace() << "Broken generator " << libname << "!";
return 0;
}
GeneratorInfo info;
......@@ -686,9 +685,9 @@ void DocumentPrivate::sendGeneratorRequest()
m_pixmapRequestsStack.pop_back();
if ( !m_warnedOutOfMemory )
{
kWarning() << "Running out of memory on page " << r->pageNumber()
<< " (" << r->width() << "x" << r->height() << " px);" << endl;
kWarning() << "this message will be reported only once." << endl;
kWarning().nospace() << "Running out of memory on page " << r->pageNumber()
<< " (" << r->width() << "x" << r->height() << " px);";
kWarning() << "this message will be reported only once.";
m_warnedOutOfMemory = true;
}
delete r;
......@@ -712,7 +711,7 @@ void DocumentPrivate::sendGeneratorRequest()
// submit the request to the generator
if ( m_generator->canGeneratePixmap() )
{
kDebug(OkularDebug) << "sending request id=" << request->id() << " " <<request->width() << "x" << request->height() << "@" << request->pageNumber() << " async == " << request->asynchronous() << endl;
kDebug(OkularDebug).nospace() << "sending request id=" << request->id() << " " <<request->width() << "x" << request->height() << "@" << request->pageNumber() << " async == " << request->asynchronous();
m_pixmapRequestsStack.removeAll ( request );
if ( (int)m_rotation % 2 )
......@@ -897,7 +896,7 @@ bool Document::openDocument( const QString & docFile, const KUrl& url, const KMi
if (offers.isEmpty())
{
emit error( i18n( "Can not find a plugin which is able to handle the passed document." ), -1 );
kWarning() << "No plugin for mimetype '" << mime->name() << "'." << endl;
kWarning().nospace() << "No plugin for mimetype '" << mime->name() << "'.";
return false;
}
int hRank=0;
......@@ -1546,7 +1545,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) << "request id=" << request->id() << " " <<request->width() << "x" << request->height() << "@" << request->pageNumber() << endl;
kDebug(OkularDebug).nospace() << "request id=" << request->id() << " " <<request->width() << "x" << request->height() << "@" << request->pageNumber();
if ( d->m_pagesVector.value( request->pageNumber() ) == 0 )
{
// skip requests referencing an invalid page (must not happen)
......@@ -1717,7 +1716,7 @@ void Document::setViewport( const DocumentViewport & viewport, int excludeId, bo
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." << endl;
// kDebug(OkularDebug) << "setViewport with the same viewport.";
// set internal viewport taking care of history
if ( oldViewport.pageNumber == viewport.pageNumber || !oldViewport.isValid() )
......@@ -2184,7 +2183,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() << "Action: Error opening '" << go->fileName() << "'." << endl;
kWarning().nospace() << "Action: Error opening '" << go->fileName() << "'.";
return;
}
else
......@@ -2333,7 +2332,7 @@ void Document::processSourceReference( const SourceReference * ref )
if ( !QFile::exists( ref->fileName() ) )
{
kDebug(OkularDebug) << "No such file: '" << ref->fileName() << "'" << endl;
kDebug(OkularDebug).nospace() << "No such file: '" << ref->fileName() << "'";
return;
}
......@@ -2457,7 +2456,7 @@ void Document::requestDone( PixmapRequest * req )
#ifndef NDEBUG
if ( !d->m_generator->canGeneratePixmap() )
kDebug(OkularDebug) << "requestDone with generator not in READY state." << endl;
kDebug(OkularDebug) << "requestDone with generator not in READY state.";
#endif
// [MEM] 1.1 find and remove a previous entry for the same page and id
......@@ -2487,7 +2486,7 @@ void Document::requestDone( PixmapRequest * req )
}
#ifndef NDEBUG
else
kWarning() << "Receiving a done request for the defunct observer " << req->id() << endl;
kWarning() << "Receiving a done request for the defunct observer" << req->id();
#endif
// 3. delete request
......@@ -2519,7 +2518,7 @@ void Document::setRotation( int r )
foreachObserver( notifySetup( d->m_pagesVector, true ) );
foreachObserver( notifyContentsCleared (DocumentObserver::Pixmap | DocumentObserver::Highlights | DocumentObserver::Annotations));
kDebug(OkularDebug) << "Rotated: " << r << endl;
kDebug(OkularDebug) << "Rotated:" << r;
}
void Document::setPageSize( const PageSize &size )
......@@ -2552,7 +2551,7 @@ void Document::setPageSize( const PageSize &size )
foreachObserver( notifySetup( d->m_pagesVector, true ) );
foreachObserver( notifyContentsCleared( DocumentObserver::Pixmap | DocumentObserver::Highlights ) );
kDebug(OkularDebug) << "New PageSize id: " << sizeid << endl;
kDebug(OkularDebug) << "New PageSize id:" << sizeid;
}
......@@ -2739,7 +2738,7 @@ void DocumentInfo::set( enum Key key, const QString &value )
set( "keywords", value, i18n( "Keywords" ) );
break;
default:
kWarning() << "DocumentInfo::set(): Invalid key passed" << endl;
kWarning() << "DocumentInfo::set(): Invalid key passed";
break;
}
}
......
......@@ -46,7 +46,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\n";
kDebug() << "changing direction in selection";
d->cur[1] = p;
}
......
......@@ -475,7 +475,7 @@ void Page::addAnnotation( Annotation * annotation )
QString uniqueName = "okular-";
uniqueName += ( QString::number(d->m_number) + '-' + QString::number(++(d->m_maxuniqueNum)) );
kDebug()<<"astario: inc m_maxuniqueNum="<<d->m_maxuniqueNum<<endl;
kDebug().nospace() << "inc m_maxuniqueNum=" << d->m_maxuniqueNum;
annotation->setUniqueName( uniqueName );
}
......@@ -540,7 +540,7 @@ bool Page::removeAnnotation( Annotation * annotation )
it = m_rects.erase( it );
rectfound = true;
}
kDebug() << "removed annotation: " << annotation->uniqueName() << endl;
kDebug() << "removed annotation:" << annotation->uniqueName();
delete *aIt;
m_annotations.erase( aIt );
break;
......@@ -688,13 +688,13 @@ void PagePrivate::restoreLocalContents( const QDomNode & pageNode )
m_maxuniqueNum = uniqID;
}
kDebug()<<"astario: restored annot:"<<annotation->uniqueName()<<endl;
kDebug() << "restored annot:" << annotation->uniqueName();
}
else
kWarning() << "page (" << m_number << "): can't restore an annotation from XML." << endl;
kWarning().nospace() << "page (" << m_number << "): can't restore an annotation from XML.";
}
#ifdef PAGE_PROFILE
kDebug() << "annots: XML Load time: " << time.elapsed() << "ms" << endl;
kDebug().nospace() << "annots: XML Load time: " << time.elapsed() << "ms";
#endif
}
// parse formList child element
......@@ -772,7 +772,7 @@ void PagePrivate::saveLocalContents( QDomNode & parentNode, QDomDocument & docum
QDomElement annElement = document.createElement( "annotation" );
AnnotationUtils::storeAnnotation( a, annElement, document );
annotListElement.appendChild( annElement );
kDebug()<<"astario: save annot:"<<a->uniqueName()<<endl;
kDebug() << "save annotation:" << a->uniqueName();
}
}
......
......@@ -14,6 +14,7 @@
#include <kdebug.h>
#include "area.h"
#include "debug_p.h"
#include "misc.h"
using namespace Okular;
......@@ -148,7 +149,7 @@ RegularAreaRect * TextPage::textArea ( TextSelection * sel) const
if ( sel->direction() == 1 || ( sel->itB() == -1 && sel->direction() == 0 ) )
{
#ifdef DEBUG_TEXTPAGE
kWarning() << "running first loop\n";
kWarning() << "running first loop";
#endif
const int count = d->m_words.count();
for ( it = 0; it < count; it++ )
......@@ -161,7 +162,7 @@ RegularAreaRect * TextPage::textArea ( TextSelection * sel) const
/// we have found the (rx,ry)x(tx,ty)
itB = it;
#ifdef DEBUG_TEXTPAGE
kWarning() << "start is " << itB << " count is " << d->m_words.count() << endl;
kWarning() << "start is" << itB << "count is" << d->m_words.count();
#endif
break;
}
......@@ -170,13 +171,13 @@ RegularAreaRect * TextPage::textArea ( TextSelection * sel) const
}
itB = sel->itB();
#ifdef DEBUG_TEXTPAGE
kWarning() << "direction is " << sel->direction() << endl;
kWarning() << "reloaded start is " << itB << " against " << sel->itB() << endl;
kWarning() << "direction is" << sel->direction();
kWarning() << "reloaded start is" << itB << "against" << sel->itB();
#endif
if ( sel->direction() == 0 || ( sel->itE() == -1 && sel->direction() == 1 ) )
{
#ifdef DEBUG_TEXTPAGE
kWarning() << "running second loop\n";
kWarning() << "running second loop";
#endif
for ( it = d->m_words.count() - 1; it >= itB; it-- )
{
......@@ -188,10 +189,10 @@ RegularAreaRect * TextPage::textArea ( TextSelection * sel) const
/// we have found the (ux,uy)x(vx,vy)
itE = it;
#ifdef DEBUG_TEXTPAGE
kWarning() << "ending is " << itE << " count is " << d->m_words.count() << endl;
kWarning () << "conditions " << tmp->contains( endCx, endCy ) << " "
kWarning() << "ending is" << itE << "count is" << d->m_words.count();
kWarning() << "conditions" << tmp->contains( endCx, endCy ) << " "
<< ( tmp->top <= endCy && tmp->bottom >= endCy && tmp->right <= endCx ) << " " <<
( tmp->top >= endCy) << endl;
( tmp->top >= endCy);
#endif
break;
}
......@@ -199,7 +200,7 @@ RegularAreaRect * TextPage::textArea ( TextSelection * sel) const
sel->itE( itE );
}
#ifdef DEBUG_TEXTPAGE
kWarning() << "reloaded ending is " << itE << " against " << sel->itE() << endl;
kWarning() << "reloaded ending is" << itE << "against" << sel->itE();
#endif
if ( sel->itB() != -1 && sel->itE() != -1 )
......@@ -326,7 +327,7 @@ RegularAreaRect* TextPage::Private::findTextInternalForward( int searchID, const
{
// lets match newline as a space
#ifdef DEBUG_TEXTPAGE
kDebug(1223) << "newline or space" << endl;
kDebug(OkularDebug) << "newline or space";
#endif
j++;
queryLeft--;
......@@ -341,7 +342,7 @@ RegularAreaRect* TextPage::Private::findTextInternalForward( int searchID, const
len=str.length();
int min=qMin(queryLeft,len);
#ifdef DEBUG_TEXTPAGE
kDebug(1223) << str.mid(offset,min) << " : " << _query.mid(j,min) << endl;
kDebug(OkularDebug) << str.mid(offset,min) << ":" << _query.mid(j,min);
#endif
// we have equal (or less then) area of the query left as the lengt of the current
// entity
......@@ -358,7 +359,7 @@ RegularAreaRect* TextPage::Private::findTextInternalForward( int searchID, const
haveMatch=false;
ret->clear();
#ifdef DEBUG_TEXTPAGE
kDebug(1223) << "\tnot matched" << endl;
kDebug(OkularDebug) << "\tnot matched";
#endif
j=0;
offset = 0;
......@@ -373,7 +374,7 @@ RegularAreaRect* TextPage::Private::findTextInternalForward( int searchID, const
// substract the length of the current entity from
// the left length of the query
#ifdef DEBUG_TEXTPAGE
kDebug(1223) << "\tmatched" << endl;
kDebug(OkularDebug) << "\tmatched";
#endif
haveMatch=true;
ret->append( *curEntity->transformedArea() );
......
......@@ -25,31 +25,31 @@
#include <stdio.h>
kdbgstream &operator<<( kdbgstream & s, const ddjvu_rect_t &r )
QDebug &operator<<( QDebug & s, const ddjvu_rect_t &r )
{
s << "[" << r.x << "," << r.y << " - " << r.w << "x" << r.h << "]";
return s;
s.nospace() << "[" << r.x << "," << r.y << " - " << r.w << "x" << r.h << "]";
return s.space();
}
static void which_ddjvu_message( const ddjvu_message_t *msg )
{
#ifdef KDJVU_DEBUG
kDebug() << "which_djvu_message(...): " << msg->m_any.tag << endl;
kDebug() << "which_djvu_message(...):" << msg->m_any.tag;
switch( msg->m_any.tag )
{
case DDJVU_ERROR:
kDebug() << "ERROR: file " << msg->m_error.filename << ", line " << msg->m_error.lineno << endl;
kDebug() << "ERROR: function '" << msg->m_error.function << "'" << endl;
kDebug() << "ERROR: '" << msg->m_error.message << "'" << endl;
kDebug().nospace() << "ERROR: file " << msg->m_error.filename << ", line " << msg->m_error.lineno;
kDebug().nospace() << "ERROR: function '" << msg->m_error.function << "'";
kDebug().nospace() << "ERROR: '" << msg->m_error.message << "'";
break;
case DDJVU_INFO:
kDebug() << "INFO: '" << msg->m_info.message << "'" << endl;
kDebug().nospace() << "INFO: '" << msg->m_info.message << "'";
break;
case DDJVU_CHUNK:
kDebug() << "CHUNK: '" << QByteArray( msg->m_chunk.chunkid ) << "'" << endl;
kDebug().nospace() << "CHUNK: '" << QByteArray( msg->m_chunk.chunkid ) << "'";
break;
case DDJVU_PROGRESS:
kDebug() << "PROGRESS: '" << msg->m_progress.percent << "'" << endl;
kDebug().nospace() << "PROGRESS: '" << msg->m_progress.percent << "'";
break;
default: ;
}
......@@ -314,7 +314,7 @@ QImage KDjVu::Private::generateImageTile( ddjvu_page_t *djvupage, int& res,
renderrect.w = realwidth;
renderrect.h = realheight;
#ifdef KDJVU_DEBUG
kDebug() << "renderrect: " << renderrect << endl;
kDebug() << "renderrect:" << renderrect;
#endif
ddjvu_rect_t pagerect;
pagerect.x = 0;
......@@ -322,14 +322,14 @@ QImage KDjVu::Private::generateImageTile( ddjvu_page_t *djvupage, int& res,
pagerect.w = width;
pagerect.h = height;
#ifdef KDJVU_DEBUG
kDebug() << "pagerect: " << pagerect << endl;
kDebug() << "pagerect:" << pagerect;
#endif
handle_ddjvu_messages( m_djvu_cxt, false );
char* imagebuffer = new char[ realwidth * realheight * 4 + 1 ];
res = ddjvu_page_render( djvupage, DDJVU_RENDER_COLOR,
&pagerect, &renderrect, m_format, realwidth * 4, imagebuffer );
#ifdef KDJVU_DEBUG
kDebug() << "rendering result: " << res << endl;
kDebug() << "rendering result:" << res;
#endif
handle_ddjvu_messages( m_djvu_cxt, false );
QImage res_img;
......@@ -463,7 +463,7 @@ bool KDjVu::openFile( const QString & fileName )
// ...and wait for its loading
wait_for_ddjvu_message( d->m_djvu_cxt, DDJVU_DOCINFO );
kDebug() << "# of pages: " << ddjvu_document_get_pagenum( d->m_djvu_document ) << endl;
kDebug() << "# of pages:" << ddjvu_document_get_pagenum( d->m_djvu_document );
int numofpages = ddjvu_document_get_pagenum( d->m_djvu_document );
d->m_pages.clear();
d->m_pages.resize( numofpages );
......@@ -507,7 +507,7 @@ bool KDjVu::openFile( const QString & fileName )
handle_ddjvu_messages( d->m_djvu_cxt, true );
if ( sts >= DDJVU_JOB_FAILED )
{
kDebug() << "\t>>> page " << i << " failed: " << sts << endl;
kDebug().nospace() << "\t>>> page " << i << " failed: " << sts;
return false;
}
......@@ -872,7 +872,7 @@ bool KDjVu::exportAsPostScript( const QString & fileName, const QList<int>& page
FILE* f = fopen( fn.constData(), "w+" );
if ( !f )
{
kDebug() << "KDjVu::exportAsPostScript(): error while opening the file" << endl;
kDebug() << "KDjVu::exportAsPostScript(): error while opening the file";
return false;
}
......
......@@ -329,7 +329,7 @@ bool PDFGenerator::loadDocument( const QString & filePath, QVector<Okular::Page*
#ifndef NDEBUG
if ( pdfdoc )
{
kDebug(PDFDebug) << "PDFGenerator: multiple calls to loadDocument. Check it." << endl;
kDebug(PDFDebug) << "PDFGenerator: multiple calls to loadDocument. Check it.";
return false;
}
#endif
......@@ -349,7 +349,7 @@ bool PDFGenerator::loadDocumentFromData( const QByteArray & fileData, QVector<Ok
#ifndef NDEBUG
if ( pdfdoc )
{
kDebug(PDFDebug) << "PDFGenerator: multiple calls to loadDocument. Check it." << endl;
kDebug(PDFDebug) << "PDFGenerator: multiple calls to loadDocument. Check it.";
return false;
}
#endif
......@@ -511,10 +511,10 @@ void PDFGenerator::loadPages(QVector<Okular::Page*> &pagesVector, int rotation,
addFormFields( p, page );
#endif
// kWarning(PDFDebug) << page->width() << "x" << page->height() << endl;
// kWarning(PDFDebug).nospace() << page->width() << "x" << page->height();
#ifdef PDFGENERATOR_DEBUG
kDebug(PDFDebug) << "load page " << i << " with rotation " << rotation << " and orientation " << orientation << endl;
kDebug(PDFDebug) << "load page" << i << "with rotation" << rotation << "and orientation" << orientation;
#endif
delete p;
......@@ -741,14 +741,14 @@ void PDFGenerator::generatePixmap( Okular::PixmapRequest * request )
{
#ifndef NDEBUG
if ( !ready )
kDebug(PDFDebug) << "calling generatePixmap() when not in READY state!" << endl;
kDebug(PDFDebug) << "calling generatePixmap() when not in READY state!";
#endif
// update busy state (not really needed here, because the flag needs to
// be set only to prevent asking a pixmap while the thread is running)
ready = false;
// debug requests to this (xpdf) generator
//kDebug(PDFDebug) << "id: " << request->id << " is requesting " << (request->async ? "ASYNC" : "sync") << " pixmap for page " << request->page->number() << " [" << request->width << " x " << request->height << "]." << endl;
//kDebug(PDFDebug) << "id: " << request->id << " is requesting " << (request->async ? "ASYNC" : "sync") << " pixmap for page " << request->page->number() << " [" << request->width << " x " << request->height << "].";
/** asynchronous requests (generation in PDFPixmapGeneratorThread::run() **/
if ( request->asynchronous() )
......@@ -820,7 +820,7 @@ void PDFGenerator::generatePixmap( Okular::PixmapRequest * request )
Okular::TextPage* PDFGenerator::textPage( Okular::Page *page )
{
kDebug(PDFDebug) << "calling textPage( Okular::Page * page )" << endl;
kDebug(PDFDebug) << "calling" << k_funcinfo;
// build a TextList...
Poppler::Page *pp = pdfdoc->page( page->number() );
docLock.lock();
......@@ -1046,7 +1046,7 @@ bool PDFGenerator::exportTo( const QString &fileName, const Okular::ExportFormat
inline void append (Okular::TextPage* ktp,
const QString &s, double l, double b, double r, double t)
{
// kWarning(PDFDebug) << "text: " << s << " at (" << l << "," << t << ")x(" << r <<","<<b<<")" << endl;
// kWarning(PDFDebug).nospace() << "text: " << s << " at (" << l << "," << t << ")x(" << r <<","<<b<<")";
ktp->append( s ,
new Okular::NormalizedRect(
l,
......@@ -1060,7 +1060,7 @@ Okular::TextPage * PDFGenerator::abstractTextPage(const QList<Poppler::TextBox*>
{
Okular::TextPage* ktp=new Okular::TextPage;
Poppler::TextBox *next;
kWarning(PDFDebug) << "getting text page in generator pdf - rotation: " << rot << endl;