Use categorized logging even more

This commit is contained in:
Frederik Gladhorn 2014-09-11 21:12:27 +02:00
parent 9d89739972
commit 6c602bf0e7
76 changed files with 486 additions and 381 deletions

View file

@ -11,7 +11,7 @@
#include <kcolorbutton.h>
#include <kcombobox.h>
#include <kdebug.h>
#include <QtCore/QDebug>
#include <kicon.h>
#include <klocalizedstring.h>
#include <klineedit.h>
@ -130,7 +130,7 @@ void WidgetAnnotTools::setTools(const QStringList& items)
QDomDocument entryParser;
if ( !entryParser.setContent( toolXml ) )
{
kWarning() << "Skipping malformed tool XML string";
qWarning() << "Skipping malformed tool XML string";
break;
}

View file

@ -11,7 +11,7 @@
#include <QtCore/QRect>
#include <QtGui/QPolygonF>
#include <kdebug.h>
#include <QtCore/QDebug>
#include <math.h>

View file

@ -14,7 +14,7 @@
#include <QtGui/QColor>
#include <QtGui/QPainterPath>
#include <QtGui/QTransform>
#include <kdebug.h>
#include <QtCore/QDebug>
#include <math.h>
#include "global.h"

View file

@ -13,7 +13,7 @@
// qt/kde includes
#include <qbuffer.h>
#include <qdir.h>
#include <kdebug.h>
#include <QtCore/QDebug>
#include <krandom.h>
#include <phonon/path.h>
#include <phonon/audiooutput.h>

View file

@ -15,7 +15,7 @@
#include <kbookmarkaction.h>
#include <kbookmarkmanager.h>
#include <kbookmarkmenu.h>
#include <kdebug.h>
#include <QtCore/QDebug>
#include <kglobal.h>
#include <kstandarddirs.h>
#include <kurl.h>

View file

@ -40,7 +40,7 @@
#include <k4aboutdata.h>
#include <kauthorized.h>
#include <kconfigdialog.h>
#include <kdebug.h>
#include <QtCore/QLoggingCategory>
#include <klibloader.h>
#include <klocale.h>
#include <kmacroexpander.h>
@ -254,7 +254,7 @@ QString DocumentPrivate::namePaperSize(double inchesWidth, double inchesHeight)
return orientation == QPrinter::Landscape ? i18nc("paper size", "unknown landscape paper size") : i18nc("paper size", "unknown portrait paper size");
}
kWarning() << "PaperSize" << paperSize << "has not been covered";
qCWarning(OkularCoreDebug) << "PaperSize" << paperSize << "has not been covered";
return QString();
}
@ -818,7 +818,7 @@ Generator * DocumentPrivate::loadGeneratorLibrary( const KService::Ptr &service
KPluginFactory *factory = KPluginLoader( service->library() ).factory();
if ( !factory )
{
kWarning(OkularCoreDebug).nospace() << "Invalid plugin factory for " << service->library() << "!";
qCWarning(OkularCoreDebug).nospace() << "Invalid plugin factory for " << service->library() << "!";
return 0;
}
@ -1442,9 +1442,9 @@ void DocumentPrivate::sendGeneratorPixmapRequest()
m_pixmapRequestsStack.pop_back();
if ( !m_warnedOutOfMemory )
{
kWarning(OkularCoreDebug).nospace() << "Running out of memory on page " << r->pageNumber()
qCWarning(OkularCoreDebug).nospace() << "Running out of memory on page " << r->pageNumber()
<< " (" << r->width() << "x" << r->height() << " px);";
kWarning(OkularCoreDebug) << "this message will be reported only once.";
qCWarning(OkularCoreDebug) << "this message will be reported only once.";
m_warnedOutOfMemory = true;
}
delete r;
@ -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(OkularCoreDebug).nospace() << "No plugin for mimetype '" << mime.name() << "'.";
qCWarning(OkularCoreDebug).nospace() << "No plugin for mimetype '" << mime.name() << "'.";
return OpenError;
}
int hRank=0;
@ -3037,7 +3037,7 @@ void Document::prepareToModifyAnnotationProperties( Annotation * annotation )
Q_ASSERT(d->m_prevPropsOfAnnotBeingModified.isNull());
if (!d->m_prevPropsOfAnnotBeingModified.isNull())
{
kError(OkularCoreDebug) << "Error: Document::prepareToModifyAnnotationProperties has already been called since last call to Document::modifyPageAnnotationProperties";
qCCritical(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(OkularCoreDebug) << "Error: Document::prepareToModifyAnnotationProperties must be called before Annotation is modified";
qCCritical(OkularCoreDebug) << "Error: Document::prepareToModifyAnnotationProperties must be called before Annotation is modified";
return;
}
QDomNode prevProps = d->m_prevPropsOfAnnotBeingModified;
@ -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(OkularCoreDebug).nospace() << "Action: Error opening '" << go->fileName() << "'.";
qCWarning(OkularCoreDebug).nospace() << "Action: Error opening '" << go->fileName() << "'.";
return;
}
else
@ -4293,7 +4293,7 @@ bool Document::saveDocumentArchive( const QString &fileName )
}
else
{
kWarning(OkularCoreDebug) << "saveChanges failed: " << errorText;
qCWarning(OkularCoreDebug) << "saveChanges failed: " << errorText;
qCDebug(OkularCoreDebug) << "Falling back to saving a copy of the original file";
}
}
@ -4405,7 +4405,7 @@ void DocumentPrivate::requestDone( PixmapRequest * req )
}
#ifndef NDEBUG
else
kWarning(OkularCoreDebug) << "Receiving a done request for the defunct observer" << observer;
qCWarning(OkularCoreDebug) << "Receiving a done request for the defunct observer" << observer;
#endif
// 3. delete request
@ -4777,7 +4777,7 @@ QString DocumentInfo::getKeyString( Key key ) //const
return "pageSize";
break;
default:
kWarning() << "Unknown" << key;
qCWarning(OkularCoreDebug) << "Unknown" << key;
return QString();
break;
}

View file

@ -26,7 +26,7 @@
#include <KShell>
#include <kstandarddirs.h>
#include <ktempdir.h>
#include <kdebug.h>
#include <QtCore/QDebug>
#include <kdeversion.h>
#include "debug_p.h"

View file

@ -15,7 +15,7 @@
#include <qeventloop.h>
#include <QtPrintSupport/QPrinter>
#include <kdebug.h>
#include <QtCore/QDebug>
#include <kicon.h>
#include <klocale.h>
#include <kwallet.h>

View file

@ -9,7 +9,7 @@
#include "generator_p.h"
#include <kdebug.h>
#include <QtCore/QDebug>
#include "fontinfo.h"
#include "generator.h"

View file

@ -9,7 +9,7 @@
#include "core/misc.h"
#include <kdebug.h>
#include <QtCore/QDebug>
#include "debug_p.h"

View file

@ -16,7 +16,7 @@
#include <qstring.h>
#include <qtemporaryfile.h>
#include <kdebug.h>
#include <QtCore/QDebug>
#include "debug_p.h"

View file

@ -19,7 +19,7 @@
#include <QtXml/QDomDocument>
#include <QtXml/QDomElement>
#include <kdebug.h>
#include <QtCore/QDebug>
// local includes
#include "action.h"
@ -823,7 +823,7 @@ void PagePrivate::restoreLocalContents( const QDomNode & pageNode )
qCDebug(OkularCoreDebug) << "restored annot:" << annotation->uniqueName();
}
else
kWarning(OkularCoreDebug).nospace() << "page (" << m_number << "): can't restore an annotation from XML.";
qCWarning(OkularCoreDebug).nospace() << "page (" << m_number << "): can't restore an annotation from XML.";
}
#ifdef PAGE_PROFILE
qCDebug(OkularCoreDebug).nospace() << "annots: XML Load time: " << time.elapsed() << "ms";

View file

@ -15,7 +15,7 @@
#include <kjs/kjsprototype.h>
#include <kjs/kjsarguments.h>
#include <kdebug.h>
#include <QtCore/QDebug>
#include "../debug_p.h"
#include "../document_p.h"
@ -94,7 +94,7 @@ void ExecutorKJS::execute( const QString &script )
int errLine;
if ( !KJSInterpreter::normalizeCode( script, &script2, &errLine, &errMsg ) )
{
kWarning(OkularCoreDebug) << "Parse error during normalization!";
qCWarning(OkularCoreDebug) << "Parse error during normalization!";
script2 = script;
}
#endif

View file

@ -14,7 +14,7 @@
#include <kjs/kjsprototype.h>
#include <kjs/kjsarguments.h>
#include <kdebug.h>
#include <QtCore/QDebug>
#include "../debug_p.h"

View file

@ -16,7 +16,7 @@
#include <kjs/kjsprototype.h>
#include <kjs/kjsarguments.h>
#include <kdebug.h>
#include <QtCore/QDebug>
#include <assert.h>
#include "../document_p.h"

View file

@ -16,7 +16,7 @@
#include <qhash.h>
#include <kdebug.h>
#include <QtCore/QDebug>
#include <kglobal.h>
#include "../debug_p.h"

View file

@ -9,7 +9,7 @@
#include "scripter.h"
#include <kdebug.h>
#include <QtCore/QDebug>
#include "debug_p.h"
#include "script/executor_kjs_p.h"

View file

@ -544,7 +544,7 @@ bool TextDocumentGenerator::reparseConfig()
void TextDocumentGenerator::addPages( KConfigDialog* /*dlg*/ )
{
kWarning() << "You forgot to reimplement addPages in your TextDocumentGenerator";
qCWarning(OkularCoreDebug) << "You forgot to reimplement addPages in your TextDocumentGenerator";
return;
}

View file

@ -18,6 +18,7 @@
#include "document.h"
#include "generator_p.h"
#include "textdocumentgenerator.h"
#include "debug_p.h"
namespace Okular {
@ -37,7 +38,7 @@ namespace TextDocumentUtils {
QTextLayout *startLayout = startBlock.layout();
QTextLayout *endLayout = endBlock.layout();
if (!startLayout || !endLayout) {
kWarning() << "Start or end layout not found" << startLayout << endLayout;
qCWarning(OkularCoreDebug) << "Start or end layout not found" << startLayout << endLayout;
page = -1;
return;
}

View file

@ -10,7 +10,7 @@
#include "textpage.h"
#include "textpage_p.h"
#include <kdebug.h>
#include <QtCore/QDebug>
#include "area.h"
#include "debug_p.h"
@ -371,7 +371,7 @@ RegularAreaRect * TextPage::textArea ( TextSelection * sel) const
if ( sel->direction() == 1 || ( sel->itB() == -1 && sel->direction() == 0 ) )
{
#ifdef DEBUG_TEXTPAGE
kWarning() << "running first loop";
qCWarning(OkularCoreDebug) << "running first loop";
#endif
const int count = d->m_words.count();
for ( it = 0; it < count; it++ )
@ -384,7 +384,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();
qCWarning(OkularCoreDebug) << "start is" << itB << "count is" << d->m_words.count();
#endif
break;
}
@ -393,13 +393,13 @@ RegularAreaRect * TextPage::textArea ( TextSelection * sel) const
}
itB = sel->itB();
#ifdef DEBUG_TEXTPAGE
kWarning() << "direction is" << sel->direction();
kWarning() << "reloaded start is" << itB << "against" << sel->itB();
qCWarning(OkularCoreDebug) << "direction is" << sel->direction();
qCWarning(OkularCoreDebug) << "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";
qCWarning(OkularCoreDebug) << "running second loop";
#endif
for ( it = d->m_words.count() - 1; it >= itB; it-- )
{
@ -411,8 +411,8 @@ 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();
kWarning() << "conditions" << tmp.contains( endCx, endCy ) << " "
qCWarning(OkularCoreDebug) << "ending is" << itE << "count is" << d->m_words.count();
qCWarning(OkularCoreDebug) << "conditions" << tmp.contains( endCx, endCy ) << " "
<< ( tmp.top <= endCy && tmp.bottom >= endCy && tmp.right <= endCx ) << " " <<
( tmp.top >= endCy);
#endif
@ -422,7 +422,7 @@ RegularAreaRect * TextPage::textArea ( TextSelection * sel) const
sel->itE( itE );
}
#ifdef DEBUG_TEXTPAGE
kWarning() << "reloaded ending is" << itE << "against" << sel->itE();
qCWarning(OkularCoreDebug) << "reloaded ending is" << itE << "against" << sel->itE();
#endif
if ( sel->itB() != -1 && sel->itE() != -1 )

View file

@ -19,7 +19,7 @@
#include <sys/stat.h>
#include <kapplication.h>
#include <kdebug.h>
#include <QtCore/QDebug>
#include <kurl.h>
#include <QMimeType>
#include <QMimeDatabase>

View file

@ -23,9 +23,10 @@
#include <core/page.h>
#include "unrar.h"
#include "debug_comicbook.h"
#include "directory.h"
#include "qnatsort.h"
#include "unrar.h"
using namespace ComicBook;
@ -196,7 +197,7 @@ void Document::pages( QVector<Okular::Page*> * pagesVector )
mPageMap.append(file);
count++;
} else {
kDebug() << "Ignoring" << file << "doesn't seem to be an image even if QImageReader::canRead returned true";
qCDebug(OkularComicbookDebug) << "Ignoring" << file << "doesn't seem to be an image even if QImageReader::canRead returned true";
}
}
}

View file

@ -19,6 +19,8 @@
#include <core/page.h>
#include <core/fileprinter.h>
#include "debug_comicbook.h"
static KAboutData createAboutData()
{
KAboutData aboutData(
@ -105,5 +107,7 @@ bool ComicBookGenerator::print( QPrinter& printer )
return true;
}
Q_LOGGING_CATEGORY(OkularComicbookDebug, "org.kde.okular.generators.comicbook")
#include "generator_comicbook.moc"

View file

@ -14,7 +14,7 @@
#include <QtCore/QFileInfo>
#include <QtCore/QRegExp>
#include <kdebug.h>
#include <QtCore/qloggingcategory.h>
#include <kglobal.h>
#include <klocale.h>
#include <kstandarddirs.h>
@ -25,6 +25,7 @@
#endif
#include "unrarflavours.h"
#include "debug_comicbook.h"
#include <memory>
@ -74,12 +75,12 @@ UnrarHelper::UnrarHelper()
if ( !kind )
{
// no luck, print that
kDebug() << "No unrar detected.";
qWarning() << "No unrar detected.";
}
else
{
unrarPath = path;
kDebug() << "detected:" << path << "(" << kind->name() << ")";
qCDebug(OkularComicbookDebug) << "detected:" << path << "(" << kind->name() << ")";
}
}

View file

@ -26,7 +26,7 @@
#include <QtGui/QPrinter>
#include <kaboutdata.h>
#include <kdebug.h>
#include <QtCore/QDebug>
#include <klocale.h>
#include <ktemporaryfile.h>

View file

@ -18,7 +18,7 @@
#include <qqueue.h>
#include <qstring.h>
#include <kdebug.h>
#include <QtCore/QDebug>
#include <klocale.h>
#include <libdjvu/ddjvuapi.h>

View file

@ -3,16 +3,18 @@
#include "TeXFontDefinition.h"
#include "dviRenderer.h"
#include "kvs_debug.h"
#include "debug_dvi.h"
#ifdef HAVE_FREETYPE
# include "TeXFont_PFB.h"
#endif
#include "TeXFont_PK.h"
#include "TeXFont_TFM.h"
#include "xdvi.h"
#include "debug_dvi.h"
#include <klocale.h>
#include <QtCore/qloggingcategory.h>
#include <QFile>
extern const int MFResolutions[];
@ -34,7 +36,7 @@ TeXFontDefinition::TeXFontDefinition(const QString &nfontname, double _displayRe
class fontPool *pool, double _enlargement)
{
#ifdef DEBUG_FONT
kDebug(kvs::dvi) << "TeXFontDefinition::TeXFontDefinition(...); fontname=" << nfontname << ", enlargement=" << _enlargement;
qCDebug(OkularDviDebug) << "TeXFontDefinition::TeXFontDefinition(...); fontname=" << nfontname << ", enlargement=" << _enlargement;
#endif
enlargement = _enlargement;
@ -60,7 +62,7 @@ TeXFontDefinition::TeXFontDefinition(const QString &nfontname, double _displayRe
TeXFontDefinition::~TeXFontDefinition()
{
#ifdef DEBUG_FONT
kDebug(kvs::dvi) << "discarding font " << fontname << " at " << (int)(enlargement * MFResolutions[font_pool->getMetafontMode()] + 0.5) << " dpi";
qCDebug(OkularDviDebug) << "discarding font " << fontname << " at " << (int)(enlargement * MFResolutions[font_pool->getMetafontMode()] + 0.5) << " dpi";
#endif
if (font != 0) {
@ -86,7 +88,7 @@ TeXFontDefinition::~TeXFontDefinition()
void TeXFontDefinition::fontNameReceiver(const QString& fname)
{
#ifdef DEBUG_FONT
kDebug(kvs::dvi) << "void TeXFontDefinition::fontNameReceiver( " << fname << " )";
qCDebug(OkularDviDebug) << "void TeXFontDefinition::fontNameReceiver( " << fname << " )";
#endif
flags |= TeXFontDefinition::FONT_LOADED;
@ -104,7 +106,7 @@ void TeXFontDefinition::fontNameReceiver(const QString& fname)
QString filename_test(font_pool->getExtraSearchPath() + '/' + filename);
file = fopen( QFile::encodeName(filename_test).constData(), "r");
if (file == 0) {
kError(kvs::dvi) << i18n("Cannot find font %1, file %2.", fontname, filename) << endl;
qCCritical(OkularDviDebug) << i18n("Cannot find font %1, file %2.", fontname, filename) << endl;
return;
} else
filename = filename_test;
@ -120,7 +122,7 @@ void TeXFontDefinition::fontNameReceiver(const QString& fname)
font = new TeXFont_PK(this);
set_char_p = &dviRenderer::set_char;
if ((checksum != 0) && (checksum != font->checksum))
kWarning(kvs::dvi) << i18n("Checksum mismatch for font file %1", filename) ;
qCWarning(OkularDviDebug) << i18n("Checksum mismatch for font file %1", filename) ;
fontType = TEX_PK;
return;
}
@ -152,12 +154,12 @@ void TeXFontDefinition::fontNameReceiver(const QString& fname)
if (enc.isEmpty() == false) {
#ifdef DEBUG_FONT
kDebug(kvs::dvi) << "Font " << fontname << " uses encoding " << enc;
qCDebug(OkularDviDebug) << "Font " << fontname << " uses encoding " << enc;
#endif
font = new TeXFont_PFB(this, font_pool->encodingPool.findByName(enc), font_pool->fontsByTeXName.findSlant(fontname) );
} else {
#ifdef DEBUG_FONT
kDebug(kvs::dvi) << "Font " << fontname << " does not have an encoding.";
qCDebug(OkularDviDebug) << "Font " << fontname << " does not have an encoding.";
#endif
font = new TeXFont_PFB(this);
}
@ -168,7 +170,7 @@ void TeXFontDefinition::fontNameReceiver(const QString& fname)
#else
// If we don't have the FreeType library, we should never have
// reached this point. Complain, and leave this font blank
kError(kvs::dvi) << i18n("Cannot recognize format for font file %1", filename) << endl;
qCCritical(OkularDviDebug) << i18n("Cannot recognize format for font file %1", filename) << endl;
#endif
}
@ -214,7 +216,7 @@ void TeXFontDefinition::setDisplayResolution(double _displayResolution_in_dpi)
void TeXFontDefinition::mark_as_used()
{
#ifdef DEBUG_FONT
kDebug(kvs::dvi) << "TeXFontDefinition::mark_as_used()";
qCDebug(OkularDviDebug) << "TeXFontDefinition::mark_as_used()";
#endif
if (flags & TeXFontDefinition::FONT_IN_USE)

View file

@ -15,10 +15,12 @@
#include "TeXFont_PFB.h"
#include "fontpool.h"
#include "kvs_debug.h"
#include "debug_dvi.h"
#include "debug_dvi.h"
#include <klocale.h>
#include <QtCore/qloggingcategory.h>
#include <QImage>
//#define DEBUG_PFB 1
@ -29,9 +31,9 @@ TeXFont_PFB::TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc, double sl
{
#ifdef DEBUG_PFB
if (enc != 0)
kDebug(kvs::dvi) << "TeXFont_PFB::TeXFont_PFB( parent=" << parent << ", encoding=" << enc->encodingFullName << " )";
qCDebug(OkularDviDebug) << "TeXFont_PFB::TeXFont_PFB( parent=" << parent << ", encoding=" << enc->encodingFullName << " )";
else
kDebug(kvs::dvi) << "TeXFont_PFB::TeXFont_PFB( parent=" << parent << ", encoding=0 )";
qCDebug(OkularDviDebug) << "TeXFont_PFB::TeXFont_PFB( parent=" << parent << ", encoding=0 )";
#endif
fatalErrorInFontLoading = false;
@ -40,13 +42,13 @@ TeXFont_PFB::TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc, double sl
if ( error == FT_Err_Unknown_File_Format ) {
errorMessage = i18n("The font file %1 could be opened and read, but its font format is unsupported.", parent->filename);
kError(kvs::dvi) << errorMessage << endl;
qCCritical(OkularDviDebug) << errorMessage << endl;
fatalErrorInFontLoading = true;
return;
} else
if ( error ) {
errorMessage = i18n("The font file %1 is broken, or it could not be opened or read.", parent->filename);
kError(kvs::dvi) << errorMessage << endl;
qCCritical(OkularDviDebug) << errorMessage << endl;
fatalErrorInFontLoading = true;
return;
}
@ -80,12 +82,12 @@ TeXFont_PFB::TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc, double sl
// the FreeType library function 'FT_Get_Name_Index()' to
// associate glyph indices to those names.
#ifdef DEBUG_PFB
kDebug(kvs::dvi) << "Trying to associate glyph indices to names from the encoding vector.";
qCDebug(OkularDviDebug) << "Trying to associate glyph indices to names from the encoding vector.";
#endif
for(int i=0; i<256; i++) {
charMap[i] = FT_Get_Name_Index( face, (FT_String *)(enc->glyphNameVector[i].toAscii().data()) );
#ifdef DEBUG_PFB
kDebug(kvs::dvi) << i << ": " << enc->glyphNameVector[i] << ", GlyphIndex=" << charMap[i];
qCDebug(OkularDviDebug) << i << ": " << enc->glyphNameVector[i] << ", GlyphIndex=" << charMap[i];
#endif
}
} else {
@ -105,14 +107,14 @@ TeXFont_PFB::TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc, double sl
// Feed the charMap array with the charmap data found in the
// previous step.
#ifdef DEBUG_PFB
kDebug(kvs::dvi) << "No encoding given: using charmap platform=7, encoding=2 that is contained in the font.";
qCDebug(OkularDviDebug) << "No encoding given: using charmap platform=7, encoding=2 that is contained in the font.";
#endif
for(int i=0; i<256; i++)
charMap[i] = FT_Get_Char_Index( face, i );
} else {
if ((found == 0) && (face->charmap != 0)) {
#ifdef DEBUG_PFB
kDebug(kvs::dvi) << "No encoding given: using charmap platform=" << face->charmap->platform_id <<
qCDebug(OkularDviDebug) << "No encoding given: using charmap platform=" << face->charmap->platform_id <<
", encoding=" << face->charmap->encoding_id << " that is contained in the font." << endl;
#endif
for(int i=0; i<256; i++)
@ -120,7 +122,7 @@ TeXFont_PFB::TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc, double sl
} else {
// As a last resort, we use the identity map.
#ifdef DEBUG_PFB
kDebug(kvs::dvi) << "No encoding given, no suitable charmaps found in the font: using identity charmap.";
qCDebug(OkularDviDebug) << "No encoding given, no suitable charmaps found in the font: using identity charmap.";
#endif
for(int i=0; i<256; i++)
charMap[i] = i;
@ -139,12 +141,12 @@ TeXFont_PFB::~TeXFont_PFB()
glyph* TeXFont_PFB::getGlyph(quint16 ch, bool generateCharacterPixmap, const QColor& color)
{
#ifdef DEBUG_PFB
kDebug(kvs::dvi) << "TeXFont_PFB::getGlyph( ch=" << ch << ", '" << (char)(ch) << "', generateCharacterPixmap=" << generateCharacterPixmap << " )";
qCDebug(OkularDviDebug) << "TeXFont_PFB::getGlyph( ch=" << ch << ", '" << (char)(ch) << "', generateCharacterPixmap=" << generateCharacterPixmap << " )";
#endif
// Paranoia checks
if (ch >= TeXFontDefinition::max_num_of_chars_in_font) {
kError(kvs::dvi) << "TeXFont_PFB::getGlyph(): Argument is too big." << endl;
qCCritical(OkularDviDebug) << "TeXFont_PFB::getGlyph(): Argument is too big." << endl;
return glyphtable;
}
@ -169,7 +171,7 @@ glyph* TeXFont_PFB::getGlyph(quint16 ch, bool generateCharacterPixmap, const QCo
QString msg = i18n("FreeType reported an error when setting the character size for font file %1.", parent->filename);
if (errorMessage.isEmpty())
errorMessage = msg;
kError(kvs::dvi) << msg << endl;
qCCritical(OkularDviDebug) << msg << endl;
g->shrunkenCharacter = QImage(1, 1, QImage::Format_RGB32);
g->shrunkenCharacter.fill(qRgb(255, 255, 255));
return g;
@ -185,7 +187,7 @@ glyph* TeXFont_PFB::getGlyph(quint16 ch, bool generateCharacterPixmap, const QCo
QString msg = i18n("FreeType is unable to load glyph #%1 from font file %2.", ch, parent->filename);
if (errorMessage.isEmpty())
errorMessage = msg;
kError(kvs::dvi) << msg << endl;
qCCritical(OkularDviDebug) << msg << endl;
g->shrunkenCharacter = QImage(1, 1, QImage::Format_RGB32);
g->shrunkenCharacter.fill(qRgb(255, 255, 255));
return g;
@ -197,7 +199,7 @@ glyph* TeXFont_PFB::getGlyph(quint16 ch, bool generateCharacterPixmap, const QCo
QString msg = i18n("FreeType is unable to render glyph #%1 from font file %2.", ch, parent->filename);
if (errorMessage.isEmpty())
errorMessage = msg;
kError(kvs::dvi) << msg << endl;
qCCritical(OkularDviDebug) << msg << endl;
g->shrunkenCharacter = QImage(1, 1, QImage::Format_RGB32);
g->shrunkenCharacter.fill(qRgb(255, 255, 255));
return g;
@ -208,7 +210,7 @@ glyph* TeXFont_PFB::getGlyph(quint16 ch, bool generateCharacterPixmap, const QCo
if ((slot->bitmap.width == 0) || (slot->bitmap.rows == 0)) {
if (errorMessage.isEmpty())
errorMessage = i18n("Glyph #%1 is empty.", ch);
kError(kvs::dvi) << i18n("Glyph #%1 from font file %2 is empty.", ch, parent->filename) << endl;
qCCritical(OkularDviDebug) << i18n("Glyph #%1 from font file %2 is empty.", ch, parent->filename) << endl;
g->shrunkenCharacter = QImage(15, 15 , QImage::Format_RGB32);
g->shrunkenCharacter.fill(qRgb(255, 0, 0));
g->x2 = 0;
@ -279,7 +281,7 @@ glyph* TeXFont_PFB::getGlyph(quint16 ch, bool generateCharacterPixmap, const QCo
QString msg = i18n("FreeType is unable to load metric for glyph #%1 from font file %2.", ch, parent->filename);
if (errorMessage.isEmpty())
errorMessage = msg;
kError(kvs::dvi) << msg << endl;
qCCritical(OkularDviDebug) << msg << endl;
g->dvi_advance_in_units_of_design_size_by_2e20 = 1;
}
g->dvi_advance_in_units_of_design_size_by_2e20 = (qint32)(((qint64)(1<<20) * (qint64)face->glyph->metrics.horiAdvance) / (qint64)face->units_per_EM);

View file

@ -54,7 +54,7 @@
#include "TeXFont_PK.h"
#include "fontpool.h"
#include "kvs_debug.h"
#include "debug_dvi.h"
#include "xdvi.h"
#include <klocale.h>
@ -80,23 +80,23 @@ TeXFont_PK::TeXFont_PK(TeXFontDefinition *parent)
: TeXFont(parent)
{
#ifdef DEBUG_PK
kDebug(kvs::dvi) << "TeXFont_PK::TeXFont_PK( parent=" << parent << ")";
qCDebug(OkularDviDebug) << "TeXFont_PK::TeXFont_PK( parent=" << parent << ")";
#endif
for(unsigned int i=0; i<TeXFontDefinition::max_num_of_chars_in_font; i++)
characterBitmaps[i] = 0;
file = fopen(QFile::encodeName(parent->filename).constData(), "r");
if (file == 0)
kError(kvs::dvi) << i18n("Cannot open font file %1.", parent->filename) << endl;
qCCritical(OkularDviDebug) << i18n("Cannot open font file %1.", parent->filename) << endl;
#ifdef DEBUG_PK
else
kDebug(kvs::dvi) << "TeXFont_PK::TeXFont_PK(): file opened successfully";
qCDebug(OkularDviDebug) << "TeXFont_PK::TeXFont_PK(): file opened successfully";
#endif
read_PK_index();
#ifdef DEBUG_PK
kDebug(kvs::dvi) << "TeXFont_PK::TeXFont_PK() ended";
qCDebug(OkularDviDebug) << "TeXFont_PK::TeXFont_PK() ended";
#endif
}
@ -119,12 +119,12 @@ TeXFont_PK::~TeXFont_PK()
glyph* TeXFont_PK::getGlyph(quint16 ch, bool generateCharacterPixmap, const QColor& color)
{
#ifdef DEBUG_PK
kDebug(kvs::dvi) << "TeXFont_PK::getGlyph( ch=" << ch << ", generateCharacterPixmap=" << generateCharacterPixmap << " )";
qCDebug(OkularDviDebug) << "TeXFont_PK::getGlyph( ch=" << ch << ", generateCharacterPixmap=" << generateCharacterPixmap << " )";
#endif
// Paranoia checks
if (ch >= TeXFontDefinition::max_num_of_chars_in_font) {
kError(kvs::dvi) << "TeXFont_PK::getGlyph(): Argument is too big." << endl;
qCCritical(OkularDviDebug) << "TeXFont_PK::getGlyph(): Argument is too big." << endl;
return glyphtable;
}
@ -136,7 +136,7 @@ glyph* TeXFont_PK::getGlyph(quint16 ch, bool generateCharacterPixmap, const QCol
// If the character is not defined in the PK file, mark the
// character as missing, and print an error message
if (g->addr == 0) {
kError(kvs::dvi) << i18n("TexFont_PK::operator[]: Character %1 not defined in font %2", ch, parent->filename) << endl;
qCCritical(OkularDviDebug) << i18n("TexFont_PK::operator[]: Character %1 not defined in font %2", ch, parent->filename) << endl;
g->addr = -1;
return g;
}
@ -373,7 +373,7 @@ static quint32 bit_masks[33] = {
int TeXFont_PK::PK_get_nyb(FILE *fp)
{
#ifdef DEBUG_PK
kDebug(kvs::dvi) << "PK_get_nyb";
qCDebug(OkularDviDebug) << "PK_get_nyb";
#endif
unsigned temp;
@ -390,7 +390,7 @@ int TeXFont_PK::PK_get_nyb(FILE *fp)
int TeXFont_PK::PK_packed_num(FILE *fp)
{
#ifdef DEBUG_PK
kDebug(kvs::dvi) << "PK_packed_num";
qCDebug(OkularDviDebug) << "PK_packed_num";
#endif
int i, j;
@ -422,7 +422,7 @@ int TeXFont_PK::PK_packed_num(FILE *fp)
void TeXFont_PK::PK_skip_specials()
{
#ifdef DEBUG_PK
kDebug(kvs::dvi) << "TeXFont_PK::PK_skip_specials() called";
qCDebug(OkularDviDebug) << "TeXFont_PK::PK_skip_specials() called";
#endif
int i,j;
@ -430,7 +430,7 @@ void TeXFont_PK::PK_skip_specials()
#ifdef DEBUG_PK
if (fp == 0)
kDebug(kvs::dvi) << "TeXFont_PK::PK_skip_specials(): file == 0";
qCDebug(OkularDviDebug) << "TeXFont_PK::PK_skip_specials(): file == 0";
#endif
do {
@ -460,7 +460,7 @@ void TeXFont_PK::PK_skip_specials()
while (PK_flag_byte != PK_POST && PK_flag_byte >= PK_CMD_START);
#ifdef DEBUG_PK
kDebug(kvs::dvi) << "TeXFont_PK::PK_skip_specials() ended";
qCDebug(OkularDviDebug) << "TeXFont_PK::PK_skip_specials() ended";
#endif
}
@ -468,7 +468,7 @@ void TeXFont_PK::PK_skip_specials()
void TeXFont_PK::read_PK_char(unsigned int ch)
{
#ifdef DEBUG_PK
kDebug(kvs::dvi) << "read_PK_char";
qCDebug(OkularDviDebug) << "read_PK_char";
#endif
int i, j;
@ -497,7 +497,7 @@ void TeXFont_PK::read_PK_char(unsigned int ch)
n = 1;
#ifdef DEBUG_PK
kDebug(kvs::dvi) << "loading pk char " << ch << ", char type " << n;
qCDebug(OkularDviDebug) << "loading pk char " << ch << ", char type " << n;
#endif
if (characterBitmaps[ch] == 0)
@ -555,7 +555,7 @@ void TeXFont_PK::read_PK_char(unsigned int ch)
// (Ultra-)Sparc processors.
#ifdef DEBUG_PK
kDebug(kvs::dvi) << "big Endian byte ordering";
qCDebug(OkularDviDebug) << "big Endian byte ordering";
#endif
if (PK_dyn_f == 14) { /* get raster by bits */
@ -641,7 +641,7 @@ void TeXFont_PK::read_PK_char(unsigned int ch)
// Intel and Alpha processors.
#ifdef DEBUG_PK
kDebug(kvs::dvi) << "small Endian byte ordering";
qCDebug(OkularDviDebug) << "small Endian byte ordering";
#endif
if (PK_dyn_f == 14) { /* get raster by bits */
@ -717,17 +717,17 @@ void TeXFont_PK::read_PK_char(unsigned int ch)
void TeXFont_PK::read_PK_index()
{
#ifdef DEBUG_PK
kDebug(kvs::dvi) << "TeXFont_PK::read_PK_index() called";
qCDebug(OkularDviDebug) << "TeXFont_PK::read_PK_index() called";
#endif
if (file == 0) {
kError(kvs::dvi) << "TeXFont_PK::read_PK_index(): file == 0" << endl;
qCCritical(OkularDviDebug) << "TeXFont_PK::read_PK_index(): file == 0" << endl;
return;
}
int magic = two(file);
if (magic != PK_MAGIC) {
kError(kvs::dvi) << "TeXFont_PK::read_PK_index(): file is not a PK file" << endl;
qCCritical(OkularDviDebug) << "TeXFont_PK::read_PK_index(): file is not a PK file" << endl;
return;
}
@ -739,7 +739,7 @@ void TeXFont_PK::read_PK_index()
int hppp = sfour(file);
int vppp = sfour(file);
if (hppp != vppp)
kWarning(kvs::dvi) << i18n("Font has non-square aspect ratio ") << vppp << ":" << hppp ;
qCWarning(OkularDviDebug) << i18n("Font has non-square aspect ratio ") << vppp << ":" << hppp ;
// Read glyph directory (really a whole pass over the file).
for (;;) {
@ -766,10 +766,10 @@ void TeXFont_PK::read_PK_index()
glyphtable[ch].x2 = PK_flag_byte;
fseek(file, (long) bytes_left, SEEK_CUR);
#ifdef DEBUG_PK
kDebug(kvs::dvi) << "Scanning pk char " << ch << "at " << glyphtable[ch].addr;
qCDebug(OkularDviDebug) << "Scanning pk char " << ch << "at " << glyphtable[ch].addr;
#endif
}
#ifdef DEBUG_PK
kDebug(kvs::dvi) << "TeXFont_PK::read_PK_index() called";
qCDebug(OkularDviDebug) << "TeXFont_PK::read_PK_index() called";
#endif
}

View file

@ -9,8 +9,10 @@
#include <config.h>
#include "TeXFont_TFM.h"
#include "kvs_debug.h"
#include "debug_dvi.h"
#include "debug_dvi.h"
#include <QtCore/qloggingcategory.h>
#include <QDataStream>
#include <QFile>
@ -21,12 +23,12 @@ TeXFont_TFM::TeXFont_TFM(TeXFontDefinition *parent)
: TeXFont(parent)
{
#ifdef DEBUG_TFM
kDebug(kvs::dvi) << "TeXFont_TFM::TeXFont_TFM( parent=" << parent << " )";
qCDebug(OkularDviDebug) << "TeXFont_TFM::TeXFont_TFM( parent=" << parent << " )";
#endif
QFile file( parent->filename );
if ( !file.open( QIODevice::ReadOnly ) ) {
kError(kvs::dvi) << "TeXFont_TFM::TeXFont_TFM(): Could not read TFM file" << endl;
qCCritical(OkularDviDebug) << "TeXFont_TFM::TeXFont_TFM(): Could not read TFM file" << endl;
return;
}
QDataStream stream( &file );
@ -36,7 +38,7 @@ TeXFont_TFM::TeXFont_TFM(TeXFontDefinition *parent)
quint16 lf, lh, bc, ec, nw, nh, nd;
stream >> lf >> lh >> bc >> ec >> nw >> nh >> nd;
#ifdef DEBUG_TFM
kDebug(kvs::dvi) << "lf= " << lf
qCDebug(OkularDviDebug) << "lf= " << lf
<< "lh= " << lh << endl
<< "bc= " << bc << endl
<< "ec= " << ec << endl
@ -45,7 +47,7 @@ TeXFont_TFM::TeXFont_TFM(TeXFontDefinition *parent)
<< "nd= " << nd << endl;
#endif
if ((bc > ec) || (ec >= TeXFontDefinition::max_num_of_chars_in_font)) {
kError(kvs::dvi) << "TeXFont_TFM::TeXFont_TFM( filename=" << parent->filename << " ): The font has an invalid bc and ec entries." << endl;
qCCritical(OkularDviDebug) << "TeXFont_TFM::TeXFont_TFM( filename=" << parent->filename << " ): The font has an invalid bc and ec entries." << endl;
file.close();
return;
}
@ -54,7 +56,7 @@ TeXFont_TFM::TeXFont_TFM(TeXFontDefinition *parent)
file.seek(24);
stream >> checksum >> design_size_in_TeX_points.value;
#ifdef DEBUG_TFM
kDebug(kvs::dvi) << "checksum = " << checksum
qCDebug(OkularDviDebug) << "checksum = " << checksum
<< "design_size = " << design_size_in_TeX_points.toDouble() << " TeX Points" << endl
<< " = " << design_size_in_TeX_points.toDouble()*254.0/7227.0 << " cm" << endl;
#endif
@ -93,7 +95,7 @@ TeXFont_TFM::TeXFont_TFM(TeXFontDefinition *parent)
quint8 byte;
stream >> byte;
if (byte >= nw)
kError(kvs::dvi) << "TeXFont_TFM::TeXFont_TFM( filename=" << parent->filename << " ): The font has an invalid Char-Info table." << endl;
qCCritical(OkularDviDebug) << "TeXFont_TFM::TeXFont_TFM( filename=" << parent->filename << " ): The font has an invalid Char-Info table." << endl;
else {
characterWidth_in_units_of_design_size[characterCode] = widthTable_in_units_of_design_size[byte];
g->dvi_advance_in_units_of_design_size_by_2e20 = widthTable_in_units_of_design_size[byte].value;
@ -102,7 +104,7 @@ TeXFont_TFM::TeXFont_TFM(TeXFontDefinition *parent)
stream >> byte;
byte = byte >> 4;
if (byte >= nh)
kError(kvs::dvi) << "TeXFont_TFM::TeXFont_TFM( filename=" << parent->filename << " ): The font has an invalid Char-Info table." << endl;
qCCritical(OkularDviDebug) << "TeXFont_TFM::TeXFont_TFM( filename=" << parent->filename << " ): The font has an invalid Char-Info table." << endl;
else
characterHeight_in_units_of_design_size[characterCode] = heightTable_in_units_of_design_size[byte];
@ -121,12 +123,12 @@ TeXFont_TFM::~TeXFont_TFM()
glyph* TeXFont_TFM::getGlyph(quint16 characterCode, bool generateCharacterPixmap, const QColor& color)
{
#ifdef DEBUG_TFM
kDebug(kvs::dvi) << "TeXFont_TFM::getGlyph( ch=" << ch << ", generateCharacterPixmap=" << generateCharacterPixmap << " )";
qCDebug(OkularDviDebug) << "TeXFont_TFM::getGlyph( ch=" << ch << ", generateCharacterPixmap=" << generateCharacterPixmap << " )";
#endif
// Paranoia checks
if (characterCode >= TeXFontDefinition::max_num_of_chars_in_font) {
kError(kvs::dvi) << "TeXFont_TFM::getGlyph(): Argument is too big." << endl;
qCCritical(OkularDviDebug) << "TeXFont_TFM::getGlyph(): Argument is too big." << endl;
return glyphtable;
}

View file

@ -10,7 +10,7 @@
#include "bigEndianByteReader.h"
#include "dvi.h"
#include "kvs_debug.h"
#include "debug_dvi.h"
//#define DEBUG_ENDIANREADER
@ -21,9 +21,9 @@ quint8 bigEndianByteReader::readUINT8()
// necessary for virtual fonts, which do not end with EOP.
if (command_pointer >= end_pointer) {
#ifdef DEBUG_ENDIANREADER
kError(kvs::dvi) << "bigEndianByteReader::readUINT8() tried to read past end of data chunk" << endl;
kError(kvs::dvi) << "end_pointer = " << end_pointer << endl;
kError(kvs::dvi) << "command_pointer = " << command_pointer << endl;
qCCritical(OkularDviDebug) << "bigEndianByteReader::readUINT8() tried to read past end of data chunk" << endl;
qCCritical(OkularDviDebug) << "end_pointer = " << end_pointer << endl;
qCCritical(OkularDviDebug) << "command_pointer = " << command_pointer << endl;
#endif
return EOP;
}

View file

@ -0,0 +1,19 @@
/***************************************************************************
* Copyright (C) 2006 by Luigi Toscano <luigi.toscano@tiscali.it> *
* 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. *
***************************************************************************/
#ifndef OKULAR_DVI_DEBUG_P_H
#define OKULAR_DVI_DEBUG_P_H
#include <QtCore/qloggingcategory.h>
Q_DECLARE_LOGGING_CATEGORY(OkularDviDebug)
Q_DECLARE_LOGGING_CATEGORY(OkularDviShellDebug)
#endif

View file

@ -52,14 +52,16 @@
#include <config.h>
#include "debug_dvi.h"
#include "dviFile.h"
#include "dvi.h"
#include "fontpool.h"
#include "kvs_debug.h"
#include "debug_dvi.h"
#include "pageSize.h"
#include <klocale.h>
#include <QtCore/qloggingcategory.h>
#include <QProcess>
#include <QSysInfo>
#include <QTemporaryFile>
@ -84,7 +86,7 @@ dvifile::dvifile(const dvifile *old, fontPool *fp)
size_of_file = old->size_of_file;
end_pointer = dvi_Data()+size_of_file;
if (dvi_Data() == 0) {
kError(kvs::dvi) << "Not enough memory to copy the DVI-file." << endl;
qCCritical(OkularDviDebug) << "Not enough memory to copy the DVI-file." << endl;
return;
}
@ -195,7 +197,7 @@ void dvifile::read_postamble()
command_pointer += len;
#ifdef DEBUG_FONTS
kDebug(kvs::dvi) << "Postamble: define font \"" << fontname << "\" scale=" << scale << " design=" << design;
qCDebug(OkularDviDebug) << "Postamble: define font \"" << fontname << "\" scale=" << scale << " design=" << design;
#endif
// According to section A.4 of the DVI driver standard, this font
@ -233,14 +235,14 @@ void dvifile::read_postamble()
void dvifile::prepare_pages()
{
#ifdef DEBUG_DVIFILE
kDebug(kvs::dvi) << "prepare_pages";
qCDebug(OkularDviDebug) << "prepare_pages";
#endif
if (total_pages == 0)
return;
page_offset.resize(total_pages+1);
if (page_offset.size() < (total_pages+1)) {
kError(kvs::dvi) << "No memory for page list!" << endl;
qCCritical(OkularDviDebug) << "No memory for page list!" << endl;
return;
}
for(int i=0; i<=total_pages; i++)
@ -269,7 +271,7 @@ void dvifile::prepare_pages()
dvifile::dvifile(const QString& fname, fontPool* pool)
{
#ifdef DEBUG_DVIFILE
kDebug(kvs::dvi) << "init_dvi_file: " << fname;
qCDebug(OkularDviDebug) << "init_dvi_file: " << fname;
#endif
errorMsg.clear();
@ -291,13 +293,13 @@ dvifile::dvifile(const QString& fname, fontPool* pool)
// whole memory buffer is readable
end_pointer = dvi_Data()+size_of_file;
if (dvi_Data() == 0) {
kError(kvs::dvi) << "Not enough memory to load the DVI-file.";
qCCritical(OkularDviDebug) << "Not enough memory to load the DVI-file.";
return;
}
file.read((char *)dvi_Data(), size_of_file);
file.close();
if (file.error() != QFile::NoError) {
kError(kvs::dvi) << "Could not load the DVI-file.";
qCCritical(OkularDviDebug) << "Could not load the DVI-file.";
return;
}
@ -316,7 +318,7 @@ dvifile::dvifile(const QString& fname, fontPool* pool)
dvifile::~dvifile()
{
#ifdef DEBUG_DVIFILE
kDebug(kvs::dvi) << "destroy dvi-file";
qCDebug(OkularDviDebug) << "destroy dvi-file";
#endif
// Delete converted PDF files

View file

@ -11,11 +11,12 @@
#include <config.h>
#include "debug_dvi.h"
#include "dviRenderer.h"
#include "dviFile.h"
#include "dvisourcesplitter.h"
#include "hyperlink.h"
#include "kvs_debug.h"
#include "debug_dvi.h"
#include "prebookmark.h"
#include "psgs.h"
//#include "renderedDviPagePixmap.h"
@ -41,9 +42,6 @@
#include <QProgressBar>
#include <QRegExp>
//#define DEBUG_DVIRENDERER
//------ now comes the dviRenderer class implementation ----------
@ -71,7 +69,7 @@ dviRenderer::dviRenderer(bool useFontHinting)
fontpoolLocateFontsDone(false)
{
#ifdef DEBUG_DVIRENDERER
//kDebug(kvs::dvi) << "dviRenderer( parent=" << par << " )";
//qCDebug(OkularDviDebug) << "dviRenderer( parent=" << par << " )";
#endif
connect( &font_pool, SIGNAL( error(QString,int) ), this, SIGNAL( error(QString,int) ) );
@ -83,7 +81,7 @@ dviRenderer::dviRenderer(bool useFontHinting)
dviRenderer::~dviRenderer()
{
#ifdef DEBUG_DVIRENDERER
kDebug(kvs::dvi) << "~dviRenderer";
qCDebug(OkularDviDebug) << "~dviRenderer";
#endif
QMutexLocker locker(&mutex);
@ -110,17 +108,17 @@ void dviRenderer::setPrefs(bool flag_showPS, const QString &str_editorCommand, b
void dviRenderer::drawPage(RenderedDocumentPagePixmap* page)
{
#ifdef DEBUG_DVIRENDERER
//kDebug(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called, page number " << page->pageNumber;
//qCDebug(OkularDviDebug) << "dviRenderer::drawPage(documentPage *) called, page number " << page->pageNumber;
#endif
// Paranoid safety checks
if (page == 0) {
kError(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called with argument == 0" << endl;
qCCritical(OkularDviDebug) << "dviRenderer::drawPage(documentPage *) called with argument == 0" << endl;
return;
}
// Paranoid safety checks
if (page->pageNumber == 0) {
kError(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called for a documentPage with page number 0" << endl;
qCCritical(OkularDviDebug) << "dviRenderer::drawPage(documentPage *) called for a documentPage with page number 0" << endl;
return;
}
@ -128,17 +126,17 @@ void dviRenderer::drawPage(RenderedDocumentPagePixmap* page)
if ( dviFile == 0 ) {
kError(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called, but no dviFile class allocated." << endl;
qCCritical(OkularDviDebug) << "dviRenderer::drawPage(documentPage *) called, but no dviFile class allocated." << endl;
page->clear();
return;
}
if (page->pageNumber > dviFile->total_pages) {
kError(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called for a documentPage with page number " << page->pageNumber
qCCritical(OkularDviDebug) << "dviRenderer::drawPage(documentPage *) called for a documentPage with page number " << page->pageNumber
<< " but the current dviFile has only " << dviFile->total_pages << " pages." << endl;
return;
}
if ( dviFile->dvi_Data() == 0 ) {
kError(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called, but no dviFile is loaded yet." << endl;
qCCritical(OkularDviDebug) << "dviRenderer::drawPage(documentPage *) called, but no dviFile is loaded yet." << endl;
page->clear();
return;
}
@ -181,7 +179,7 @@ void dviRenderer::drawPage(RenderedDocumentPagePixmap* page)
}
else
{
kDebug(kvs::dvi) << "painter creation failed.";
qCDebug(OkularDviDebug) << "painter creation failed.";
}
page->img = img;
//page->setImage(img);
@ -324,7 +322,7 @@ void dviRenderer::showThatSourceInformationIsPresent()
void dviRenderer::embedPostScript()
{
#ifdef DEBUG_DVIRENDERER
kDebug(kvs::dvi) << "dviRenderer::embedPostScript()";
qCDebug(OkularDviDebug) << "dviRenderer::embedPostScript()";
#endif
if (!dviFile)
@ -369,7 +367,7 @@ void dviRenderer::embedPostScript()
// Prescan phase starts here
#ifdef PERFORMANCE_MEASUREMENT
//kDebug(kvs::dvi) << "Time elapsed till prescan phase starts " << performanceTimer.elapsed() << "ms";
//qCDebug(OkularDviDebug) << "Time elapsed till prescan phase starts " << performanceTimer.elapsed() << "ms";
//QTime preScanTimer;
//preScanTimer.start();
#endif
@ -398,7 +396,7 @@ void dviRenderer::embedPostScript()
#ifdef PERFORMANCE_MEASUREMENT
//kDebug(kvs::dvi) << "Time required for prescan phase: " << preScanTimer.restart() << "ms";
//qCDebug(OkularDviDebug) << "Time required for prescan phase: " << preScanTimer.restart() << "ms";
#endif
current_page = currPageSav;
_isModified = true;
@ -431,7 +429,7 @@ bool dviRenderer::isValidFile(const QString& filename) const
bool dviRenderer::setFile(const QString &fname, const KUrl &base)
{
#ifdef DEBUG_DVIRENDERER
kDebug(kvs::dvi) << "dviRenderer::setFile( fname='" << fname << "' )"; //, ref='" << ref << "', sourceMarker=" << sourceMarker << " )";
qCDebug(OkularDviDebug) << "dviRenderer::setFile( fname='" << fname << "' )"; //, ref='" << ref << "', sourceMarker=" << sourceMarker << " )";
#endif
//QMutexLocker lock(&mutex);
@ -511,7 +509,7 @@ bool dviRenderer::setFile(const QString &fname, const KUrl &base)
// PRESCAN STARTS HERE
#ifdef PERFORMANCE_MEASUREMENT
//kDebug(kvs::dvi) << "Time elapsed till prescan phase starts " << performanceTimer.elapsed() << "ms";
//qCDebug(OkularDviDebug) << "Time elapsed till prescan phase starts " << performanceTimer.elapsed() << "ms";
//QTime preScanTimer;
//preScanTimer.start();
#endif
@ -560,7 +558,7 @@ bool dviRenderer::setFile(const QString &fname, const KUrl &base)
#endif
#ifdef PERFORMANCE_MEASUREMENT
//kDebug(kvs::dvi) << "Time required for prescan phase: " << preScanTimer.restart() << "ms";
//qCDebug(OkularDviDebug) << "Time required for prescan phase: " << preScanTimer.restart() << "ms";
#endif
current_page = currPageSav;
// PRESCAN ENDS HERE
@ -579,7 +577,7 @@ Anchor dviRenderer::parseReference(const QString &reference)
QMutexLocker locker(&mutex);
#ifdef DEBUG_DVIRENDERER
kError(kvs::dvi) << "dviRenderer::parseReference( " << reference << " ) called" << endl;
qCCritical(OkularDviDebug) << "dviRenderer::parseReference( " << reference << " ) called" << endl;
#endif
if (dviFile == 0)

View file

@ -54,11 +54,12 @@
#include <config.h>
#include "debug_dvi.h"
#include "dviRenderer.h"
#include "dvi.h"
#include "dviFile.h"
#include "hyperlink.h"
#include "kvs_debug.h"
#include "debug_dvi.h"
#include "psgs.h"
//#include "renderedDviPagePixmap.h"
#include "TeXFont.h"
@ -68,6 +69,7 @@
#include <klocale.h>
#include <QPainter>
#include <QtCore/qloggingcategory.h>
@ -76,7 +78,7 @@
void dviRenderer::set_char(unsigned int cmd, unsigned int ch)
{
#ifdef DEBUG_RENDER
kDebug(kvs::dvi) << "set_char #" << ch;
qCDebug(OkularDviDebug) << "set_char #" << ch;
#endif
glyph *g;
@ -205,13 +207,13 @@ void dviRenderer::set_empty_char(unsigned int, unsigned int)
void dviRenderer::set_vf_char(unsigned int cmd, unsigned int ch)
{
#ifdef DEBUG_RENDER
kDebug(kvs::dvi) << "dviRenderer::set_vf_char( cmd=" << cmd << ", ch=" << ch << " )";
qCDebug(OkularDviDebug) << "dviRenderer::set_vf_char( cmd=" << cmd << ", ch=" << ch << " )";
#endif
static unsigned char c;
macro *m = &currinf.fontp->macrotable[ch];
if (m->pos == NULL) {
kError(kvs::dvi) << "Character " << ch << " not defined in font " << currinf.fontp->fontname << endl;
qCCritical(OkularDviDebug) << "Character " << ch << " not defined in font " << currinf.fontp->fontname << endl;
m->pos = m->end = &c;
return;
}
@ -246,7 +248,7 @@ void dviRenderer::set_vf_char(unsigned int cmd, unsigned int ch)
void dviRenderer::set_no_char(unsigned int cmd, unsigned int ch)
{
#ifdef DEBUG_RENDER
kDebug(kvs::dvi) << "dviRenderer::set_no_char( cmd=" << cmd << ", ch =" << ch << " )" ;
qCDebug(OkularDviDebug) << "dviRenderer::set_no_char( cmd=" << cmd << ", ch =" << ch << " )" ;
#endif
if (currinf._virtual) {
@ -266,7 +268,7 @@ void dviRenderer::set_no_char(unsigned int cmd, unsigned int ch)
void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro)
{
#ifdef DEBUG_RENDER
kDebug(kvs::dvi) << "draw_part";
qCDebug(OkularDviDebug) << "draw_part";
#endif
qint32 RRtmp=0, WWtmp=0, XXtmp=0, YYtmp=0, ZZtmp=0;
@ -371,7 +373,7 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro)
// that at the end of a page, the stack should always be
// empty.
if (!stack.isEmpty()) {
kDebug(kvs::dvi) << "DRAW: The stack was not empty when the EOP command was encountered.";
qCDebug(OkularDviDebug) << "DRAW: The stack was not empty when the EOP command was encountered.";
errorMsg = i18n("The stack was not empty when the EOP command was encountered.");
return;
}
@ -579,7 +581,7 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro)
#ifdef DEBUG_RENDER
if (currentlyDrawnPage->textBoxList.size() > 0)
kDebug(kvs::dvi) << "Element:"
qCDebug(OkularDviDebug) << "Element:"
<< currentlyDrawnPage->textBoxList.last().box
<< currentlyDrawnPage->textBoxList.last().text
<< " ? s:" << space_encountered
@ -610,7 +612,7 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro)
QString lastword(currentlyDrawnPage->textBoxList[last_space_index].text);
for (int lidx = last_space_index+1; lidx<currentlyDrawnPage->textBoxList.size(); ++lidx)
lastword += currentlyDrawnPage->textBoxList[lidx].text;
kDebug(kvs::dvi) << "space encountered: '" << lastword << "'";
qCDebug(OkularDviDebug) << "space encountered: '" << lastword << "'";
#endif
last_space_index = currentlyDrawnPage->textBoxList.size();
after_space = true;
@ -642,14 +644,14 @@ void dviRenderer::draw_page()
// elapsed till the kdvi_multipage was constructed, and print
// it. Set the flag so that is message will not be printed again.
if (performanceFlag == 0) {
kDebug(kvs::dvi) << "Time elapsed till the first page is drawn: " << performanceTimer.restart() << "ms";
qCDebug(OkularDviDebug) << "Time elapsed till the first page is drawn: " << performanceTimer.restart() << "ms";
performanceFlag = 1;
}
#endif
#ifdef DEBUG_RENDER
kDebug(kvs::dvi) <<"draw_page";
qCDebug(OkularDviDebug) <<"draw_page";
#endif
#if 0

View file

@ -11,7 +11,7 @@
#include "dviRenderer.h"
#include "dvi.h"
#include "dviFile.h"
#include "kvs_debug.h"
#include "debug_dvi.h"
#include "prebookmark.h"
#include "psgs.h"
#include "TeXFont.h"
@ -40,7 +40,7 @@ extern void parse_special_argument(const QString& strg, const char* argument_nam
void dviRenderer::prescan_embedPS(char *cp, quint8 *beginningOfSpecialCommand)
{
#ifdef DEBUG_PRESCAN
kDebug(kvs::dvi) << "dviRenderer::prescan_embedPS( cp = " << cp << " ) ";
qCDebug(OkularDviDebug) << "dviRenderer::prescan_embedPS( cp = " << cp << " ) ";
#endif
// Encapsulated Postscript File
@ -226,7 +226,7 @@ void dviRenderer::prescan_embedPS(char *cp, quint8 *beginningOfSpecialCommand)
void dviRenderer::prescan_removePageSizeInfo(char *cp, quint8 *beginningOfSpecialCommand)
{
#ifdef DEBUG_PRESCAN
kDebug(kvs::dvi) << "dviRenderer::prescan_embedPS( cp = " << cp << " ) ";
qCDebug(OkularDviDebug) << "dviRenderer::prescan_embedPS( cp = " << cp << " ) ";
#endif
// Encapsulated Postscript File
@ -241,7 +241,7 @@ void dviRenderer::prescan_removePageSizeInfo(char *cp, quint8 *beginningOfSpecia
void dviRenderer::prescan_ParsePapersizeSpecial(const QString& _cp)
{
#ifdef DEBUG_PRESCAN
kDebug(kvs::dvi) << "Papersize-Special : papersize" << _cp;
qCDebug(OkularDviDebug) << "Papersize-Special : papersize" << _cp;
#endif
QString cp = _cp.simplified();
@ -280,7 +280,7 @@ void dviRenderer::prescan_ParseHTMLAnchorSpecial(const QString& _cp)
void dviRenderer::prescan_ParsePSHeaderSpecial(const QString& cp)
{
#ifdef DEBUG_PRESCAN
kDebug(kvs::dvi) << "PostScript-special, header " << cp;
qCDebug(OkularDviDebug) << "PostScript-special, header " << cp;
#endif
QString _file = cp;
@ -304,7 +304,7 @@ void dviRenderer::prescan_ParsePSHeaderSpecial(const QString& cp)
void dviRenderer::prescan_ParsePSBangSpecial(const QString& cp)
{
#ifdef DEBUG_PRESCAN
kDebug(kvs::dvi) << "PostScript-special, literal header " << cp;
qCDebug(OkularDviDebug) << "PostScript-special, literal header " << cp;
#endif
PS_interface->PostScriptHeaderString->append( " @defspecial \n" );
@ -316,7 +316,7 @@ void dviRenderer::prescan_ParsePSBangSpecial(const QString& cp)
void dviRenderer::prescan_ParsePSQuoteSpecial(const QString& cp)
{
#ifdef DEBUG_PRESCAN
kError(kvs::dvi) << "PostScript-special, literal PostScript " << cp;
qCCritical(OkularDviDebug) << "PostScript-special, literal PostScript " << cp;
#endif
double PS_H = (currinf.data.dvi_h*300.0)/(65536*1200)-300;
@ -331,7 +331,7 @@ void dviRenderer::prescan_ParsePSQuoteSpecial(const QString& cp)
void dviRenderer::prescan_ParsePSSpecial(const QString& cp)
{
#ifdef DEBUG_PRESCAN
kDebug(kvs::dvi) << "PostScript-special, direct PostScript " << cp;
qCDebug(OkularDviDebug) << "PostScript-special, direct PostScript " << cp;
#endif
// Unfortunately, in some TeX distribution the hyperref package uses
@ -402,7 +402,7 @@ void dviRenderer::prescan_ParsePSSpecial(const QString& cp)
void dviRenderer::prescan_ParsePSFileSpecial(const QString& cp)
{
#ifdef DEBUG_PRESCAN
kDebug(kvs::dvi) << "epsf-special: psfile=" << cp;
qCDebug(OkularDviDebug) << "epsf-special: psfile=" << cp;
#endif
QString include_command = cp.simplified();
@ -621,7 +621,7 @@ void dviRenderer::prescan_setChar(unsigned int ch)
void dviRenderer::prescan(parseSpecials specialParser)
{
#ifdef DEBUG_PRESCAN
kDebug(kvs::dvi) << "dviRenderer::prescan( ... )";
qCDebug(OkularDviDebug) << "dviRenderer::prescan( ... )";
#endif
if (resolutionInDPI == 0.0)

View file

@ -23,7 +23,7 @@
#include "dviFile.h"
#include "dviRenderer.h"
#include "kvs_debug.h"
#include "debug_dvi.h"
#include <KStandardDirs>
#include <kfiledialog.h>
@ -77,7 +77,7 @@ void DVIExport::start(const QString& command,
process_->start();
if (!process_->waitForStarted(-1))
kError(kvs::dvi) << command << " failed to start" << endl;
qCCritical(OkularDviDebug) << command << " failed to start" << endl;
else
started_ = true;

View file

@ -10,7 +10,7 @@
#include <config.h>
#include "dvisourcesplitter.h"
#include "kvs_debug.h"
#include "debug_dvi.h"
#include <QDir>
@ -26,7 +26,7 @@ DVI_SourceFileSplitter::DVI_SourceFileSplitter(const QString &srclink, const QSt
bool possibleNumberMixUp = false;
#ifdef DEBUG_SOURCESPLITTER
kDebug(kvs::dvi) << "DVI_SourceSplitter: srclink " << srclink;
qCDebug(OkularDviDebug) << "DVI_SourceSplitter: srclink " << srclink;
#endif
//remove src: if necessary
@ -46,7 +46,7 @@ DVI_SourceFileSplitter::DVI_SourceFileSplitter(const QString &srclink, const QSt
linepart = linepart.trimmed();
#ifdef DEBUG_SOURCESPLITTER
kDebug(kvs::dvi) << "DVI_SourceSplitter: filepart " << filepart << " linepart " << linepart;
qCDebug(OkularDviDebug) << "DVI_SourceSplitter: filepart " << filepart << " linepart " << linepart;
#endif
//test if the file exists
@ -70,12 +70,12 @@ DVI_SourceFileSplitter::DVI_SourceFileSplitter(const QString &srclink, const QSt
{
tempInfo.setFile(linepart.right(index) + tempFileName);
#ifdef DEBUG_SOURCESPLITTER
kDebug(kvs::dvi) << "DVI_SourceSplitter: trying " << tempInfo.fileName();
qCDebug(OkularDviDebug) << "DVI_SourceSplitter: trying " << tempInfo.fileName();
#endif
if ( tempInfo.exists() ) { found = true; break;}
tempInfo.setFile(linepart.right(index) + tempFileName + ".tex");
#ifdef DEBUG_SOURCESPLITTER
kDebug(kvs::dvi) << "DVI_SourceSplitter: trying " << tempInfo.fileName();
qCDebug(OkularDviDebug) << "DVI_SourceSplitter: trying " << tempInfo.fileName();
#endif
if ( tempInfo.exists() ) { found = true; break;}
}
@ -92,6 +92,6 @@ DVI_SourceFileSplitter::DVI_SourceFileSplitter(const QString &srclink, const QSt
if (!ok) m_line = 0;
#ifdef DEBUG_SOURCESPLITTER
kDebug(kvs::dvi) << "DVI_SourceSplitter: result: file " << m_fileInfo.absoluteFilePath() << " line " << m_line;
qCDebug(OkularDviDebug) << "DVI_SourceSplitter: result: file " << m_fileInfo.absoluteFilePath() << " line " << m_line;
#endif
}

View file

@ -11,8 +11,9 @@
#ifdef HAVE_FREETYPE
#include "fontEncoding.h"
#include "kvs_debug.h"
#include "debug_dvi.h"
#include <QtCore/qloggingcategory.h>
#include <QFile>
#include <QProcess>
#include <QTextStream>
@ -23,7 +24,7 @@
fontEncoding::fontEncoding(const QString &encName)
{
#ifdef DEBUG_FONTENC
kDebug(kvs::dvi) << "fontEncoding( " << encName << " )";
qCDebug(OkularDviDebug) << "fontEncoding( " << encName << " )";
#endif
_isValid = false;
@ -36,7 +37,7 @@ fontEncoding::fontEncoding(const QString &encName)
QIODevice::ReadOnly|QIODevice::Text);
if (!kpsewhich.waitForStarted()) {
kError(kvs::dvi) << "fontEncoding::fontEncoding(...): kpsewhich could not be started." << endl;
qCCritical(OkularDviDebug) << "fontEncoding::fontEncoding(...): kpsewhich could not be started." << endl;
return;
}
@ -45,12 +46,12 @@ fontEncoding::fontEncoding(const QString &encName)
const QString encFileName = QString(kpsewhich.readAll()).trimmed();
if (encFileName.isEmpty()) {
kError(kvs::dvi) << QString("fontEncoding::fontEncoding(...): The file '%1' could not be found by kpsewhich.").arg(encName) << endl;
qCCritical(OkularDviDebug) << QString("fontEncoding::fontEncoding(...): The file '%1' could not be found by kpsewhich.").arg(encName) << endl;
return;
}
#ifdef DEBUG_FONTENC
kDebug(kvs::dvi) << "FileName of the encoding: " << encFileName;
qCDebug(OkularDviDebug) << "FileName of the encoding: " << encFileName;
#endif
QFile file( encFileName );
@ -68,7 +69,7 @@ fontEncoding::fontEncoding(const QString &encName)
// Find the name of the encoding
encodingFullName = fileContent.section('[', 0, 0).simplified().mid(1);
#ifdef DEBUG_FONTENC
kDebug(kvs::dvi) << "encodingFullName: " << encodingFullName;
qCDebug(OkularDviDebug) << "encodingFullName: " << encodingFullName;
#endif
fileContent = fileContent.section('[', 1, 1).section(']',0,0).simplified();
@ -78,14 +79,14 @@ fontEncoding::fontEncoding(const QString &encName)
for ( QStringList::ConstIterator it = glyphNameList.constBegin(); (it != glyphNameList.constEnd())&&(i<256); ++it ) {
glyphNameVector[i] = (*it).simplified();
#ifdef DEBUG_FONTENC
kDebug(kvs::dvi) << i << ": " << glyphNameVector[i];
qCDebug(OkularDviDebug) << i << ": " << glyphNameVector[i];
#endif
i++;
}
for(; i<256; i++)
glyphNameVector[i] = ".notdef";
} else {
kError(kvs::dvi) << QString("fontEncoding::fontEncoding(...): The file '%1' could not be opened.").arg(encFileName) << endl;
qCCritical(OkularDviDebug) << QString("fontEncoding::fontEncoding(...): The file '%1' could not be opened.").arg(encFileName) << endl;
return;
}

View file

@ -11,8 +11,8 @@
#ifdef HAVE_FREETYPE
#include "fontMap.h"
#include "kvs_debug.h"
#include "debug_dvi.h"
#include <QtCore/qloggingcategory.h>
#include <QFile>
#include <QProcess>
#include <QTextStream>
@ -41,7 +41,7 @@ fontMap::fontMap()
QIODevice::ReadOnly|QIODevice::Text);
if (!kpsewhich.waitForStarted()) {
kError(kvs::dvi) << "fontMap::fontMap(): kpsewhich could not be started." << endl;
qCCritical(OkularDviDebug) << "fontMap::fontMap(): kpsewhich could not be started." << endl;
return;
}
@ -56,7 +56,7 @@ fontMap::fontMap()
QStringList() << "--format=dvips config" << "ps2pk.map",
QIODevice::ReadOnly|QIODevice::Text);
if (!kpsewhich.waitForStarted()) {
kError(kvs::dvi) << "fontMap::fontMap(): kpsewhich could not be started." << endl;
qCCritical(OkularDviDebug) << "fontMap::fontMap(): kpsewhich could not be started." << endl;
return;
}
@ -65,7 +65,7 @@ fontMap::fontMap()
map_fileName = QString(kpsewhich.readAll()).trimmed();
// If both versions fail, then there is nothing left to do.
if (map_fileName.isEmpty()) {
kError(kvs::dvi) << "fontMap::fontMap(): The file 'ps2pk.map' could not be found by kpsewhich." << endl;
qCCritical(OkularDviDebug) << "fontMap::fontMap(): The file 'ps2pk.map' could not be found by kpsewhich." << endl;
return;
}
}
@ -109,13 +109,13 @@ fontMap::fontMap()
}
file.close();
} else
kError(kvs::dvi) << QString("fontMap::fontMap(): The file '%1' could not be opened.").arg(map_fileName) << endl;
qCCritical(OkularDviDebug) << QString("fontMap::fontMap(): The file '%1' could not be opened.").arg(map_fileName) << endl;
#ifdef DEBUG_FONTMAP
kDebug(kvs::dvi) << "FontMap file parsed. Results:";
qCDebug(OkularDviDebug) << "FontMap file parsed. Results:";
QMap<QString, fontMapEntry>::Iterator it;
for ( it = fontMapEntries.begin(); it != fontMapEntries.end(); ++it )
kDebug(kvs::dvi) << "TeXName: " << it.key()
qCDebug(OkularDviDebug) << "TeXName: " << it.key()
<< ", FontFileName=" << it.data().fontFileName
<< ", FullName=" << it.data().fullFontName
<< ", Encoding=" << it.data().fontEncoding

View file

@ -8,7 +8,7 @@
#include <config.h>
#include "fontpool.h"
#include "kvs_debug.h"
#include "debug_dvi.h"
#include "TeXFont.h"
#include <klocale.h>
@ -36,7 +36,7 @@ bool fontPoolTimerFlag;
fontPool::fontPool(bool useFontHinting)
{
#ifdef DEBUG_FONTPOOL
kDebug(kvs::dvi) << "fontPool::fontPool() called";
qCDebug(OkularDviDebug) << "fontPool::fontPool() called";
#endif
setObjectName( QLatin1String("Font Pool" ));
@ -49,7 +49,7 @@ fontPool::fontPool(bool useFontHinting)
#ifdef HAVE_FREETYPE
// Initialize the Freetype Library
if ( FT_Init_FreeType( &FreeType_library ) != 0 ) {
kError(kvs::dvi) << "Cannot load the FreeType library. KDVI proceeds without FreeType support." << endl;
qCCritical(OkularDviDebug) << "Cannot load the FreeType library. KDVI proceeds without FreeType support." << endl;
FreeType_could_be_loaded = false;
} else
FreeType_could_be_loaded = true;
@ -74,12 +74,12 @@ fontPool::fontPool(bool useFontHinting)
if ((result == 0xff) || (result == 0x00)) {
#ifdef DEBUG_FONTPOOL
kDebug(kvs::dvi) << "fontPool::fontPool(): QPixmap does not support the alpha channel";
qCDebug(OkularDviDebug) << "fontPool::fontPool(): QPixmap does not support the alpha channel";
#endif
QPixmapSupportsAlpha = false;
} else {
#ifdef DEBUG_FONTPOOL
kDebug(kvs::dvi) << "fontPool::fontPool(): QPixmap supports the alpha channel";
qCDebug(OkularDviDebug) << "fontPool::fontPool(): QPixmap supports the alpha channel";
#endif
QPixmapSupportsAlpha = true;
}
@ -89,7 +89,7 @@ fontPool::fontPool(bool useFontHinting)
fontPool::~fontPool()
{
#ifdef DEBUG_FONTPOOL
kDebug(kvs::dvi) << "fontPool::~fontPool() called";
qCDebug(OkularDviDebug) << "fontPool::~fontPool() called";
#endif
// need to manually clear the fonts _before_ freetype gets unloaded
@ -140,7 +140,7 @@ TeXFontDefinition* fontPool::appendx(const QString& fontname, quint32 checksum,
TeXFontDefinition *fontp = new TeXFontDefinition(fontname, displayResolution*enlargement, checksum, scale, this, enlargement);
if (fontp == 0) {
kError(kvs::dvi) << "Could not allocate memory for a font structure";
qCCritical(OkularDviDebug) << "Could not allocate memory for a font structure";
exit(0);
}
fontList.append(fontp);
@ -158,7 +158,7 @@ TeXFontDefinition* fontPool::appendx(const QString& fontname, quint32 checksum,
bool fontPool::areFontsLocated()
{
#ifdef DEBUG_FONTPOOL
kDebug(kvs::dvi) << "fontPool::areFontsLocated() called";
qCDebug(OkularDviDebug) << "fontPool::areFontsLocated() called";
#endif
// Is there a font whose name we did not try to find out yet?
@ -170,7 +170,7 @@ bool fontPool::areFontsLocated()
}
#ifdef DEBUG_FONTPOOL
kDebug(kvs::dvi) << "... yes, all fonts are located (but not necessarily loaded).";
qCDebug(OkularDviDebug) << "... yes, all fonts are located (but not necessarily loaded).";
#endif
return true; // That says that all fonts are located.
}
@ -326,7 +326,7 @@ void fontPool::locateFonts(bool makePK, bool locateTFMonly, bool *virtualFontsFo
if (matchingFiles.isEmpty() != true) {
#ifdef DEBUG_FONTPOOL
kDebug(kvs::dvi) << "Associated " << fontp->fontname << " to " << matchingFiles.first();
qCDebug(OkularDviDebug) << "Associated " << fontp->fontname << " to " << matchingFiles.first();
#endif
QString fname = matchingFiles.first();
fontp->fontNameReceiver(fname);
@ -350,7 +350,7 @@ void fontPool::locateFonts(bool makePK, bool locateTFMonly, bool *virtualFontsFo
void fontPool::setCMperDVIunit( double _CMperDVI )
{
#ifdef DEBUG_FONTPOOL
kDebug(kvs::dvi) << "fontPool::setCMperDVIunit( " << _CMperDVI << " )";
qCDebug(OkularDviDebug) << "fontPool::setCMperDVIunit( " << _CMperDVI << " )";
#endif
if (CMperDVIunit == _CMperDVI)
@ -369,7 +369,7 @@ void fontPool::setCMperDVIunit( double _CMperDVI )
void fontPool::setDisplayResolution( double _displayResolution_in_dpi )
{
#ifdef DEBUG_FONTPOOL
kDebug(kvs::dvi) << "fontPool::setDisplayResolution( displayResolution_in_dpi=" << _displayResolution_in_dpi << " ) called";
qCDebug(OkularDviDebug) << "fontPool::setDisplayResolution( displayResolution_in_dpi=" << _displayResolution_in_dpi << " ) called";
#endif
// Ignore minute changes by less than 2 DPI. The difference would
@ -378,7 +378,7 @@ void fontPool::setDisplayResolution( double _displayResolution_in_dpi )
// changes the window size by 1 pixel all the time.
if ( fabs(displayResolution_in_dpi - _displayResolution_in_dpi) <= 2.0 ) {
#ifdef DEBUG_FONTPOOL
kDebug(kvs::dvi) << "fontPool::setDisplayResolution(...): resolution wasn't changed. Aborting.";
qCDebug(OkularDviDebug) << "fontPool::setDisplayResolution(...): resolution wasn't changed. Aborting.";
#endif
return;
}
@ -413,7 +413,7 @@ void fontPool::markFontsAsLocated()
void fontPool::mark_fonts_as_unused()
{
#ifdef DEBUG_FONTPOOL
kDebug(kvs::dvi) << "fontPool::mark_fonts_as_unused() called";
qCDebug(OkularDviDebug) << "fontPool::mark_fonts_as_unused() called";
#endif
QList<TeXFontDefinition*>::iterator it_fontp = fontList.begin();
@ -427,7 +427,7 @@ void fontPool::mark_fonts_as_unused()
void fontPool::release_fonts()
{
#ifdef DEBUG_FONTPOOL
kDebug(kvs::dvi) << "Release_fonts";
qCDebug(OkularDviDebug) << "Release_fonts";
#endif
QMutableListIterator<TeXFontDefinition*> it_fontp(fontList);
@ -454,7 +454,7 @@ void fontPool::mf_output_receiver()
while( (numleft = MetafontOutput.indexOf('\n')) != -1) {
QString line = MetafontOutput.left(numleft+1);
#ifdef DEBUG_FONTPOOL
kDebug(kvs::dvi) << "MF OUTPUT RECEIVED: " << line;
qCDebug(OkularDviDebug) << "MF OUTPUT RECEIVED: " << line;
#endif
// If the Output of the kpsewhich program contains a line starting
// with "kpathsea:", this means that a new MetaFont-run has been

View file

@ -16,6 +16,7 @@
#include <core/utils.h>
#include "generator_dvi.h"
#include "debug_dvi.h"
#include "dviFile.h"
#include "dviPageInfo.h"
#include "dviRenderer.h"
@ -31,7 +32,7 @@
#include <qmutex.h>
#include <kaboutdata.h>
#include <kdebug.h>
#include <QtCore/QDebug>
#include <klocale.h>
#include <ktemporaryfile.h>
@ -74,7 +75,7 @@ DviGenerator::DviGenerator( QObject *parent, const QVariantList &args ) : Okular
bool DviGenerator::loadDocument( const QString & fileName, QVector< Okular::Page * > &pagesVector )
{
//kDebug(DviDebug) << "file:" << fileName;
//qCDebug(OkularDviDebug) << "file:" << fileName;
KUrl base( fileName );
(void)userMutex();
@ -89,7 +90,7 @@ bool DviGenerator::loadDocument( const QString & fileName, QVector< Okular::Page
int iter = 0;
for ( ; !m_dviRenderer->isValidFile( fileName ) && iter < s_maxIterations; ++iter )
{
kDebug(DviDebug).nospace() << "file not valid after iteration #" << iter << "/" << s_maxIterations << ", waiting for " << s_waitTime;
qCDebug(OkularDviDebug).nospace() << "file not valid after iteration #" << iter << "/" << s_maxIterations << ", waiting for " << s_waitTime;
#ifdef Q_OS_WIN
Sleep( uint( s_waitTime ) );
#else
@ -99,7 +100,7 @@ bool DviGenerator::loadDocument( const QString & fileName, QVector< Okular::Page
}
if ( iter >= s_maxIterations && !m_dviRenderer->isValidFile( fileName ) )
{
kDebug(DviDebug) << "file still not valid after" << s_maxIterations;
qCDebug(OkularDviDebug) << "file still not valid after" << s_maxIterations;
delete m_dviRenderer;
m_dviRenderer = 0;
return false;
@ -119,7 +120,7 @@ bool DviGenerator::loadDocument( const QString & fileName, QVector< Okular::Page
return false;
}
kDebug(DviDebug) << "# of pages:" << m_dviRenderer->dviFile->total_pages;
qCDebug(OkularDviDebug) << "# of pages:" << m_dviRenderer->dviFile->total_pages;
m_resolution = Okular::Utils::dpiY();
loadPages( pagesVector );
@ -242,7 +243,7 @@ QImage DviGenerator::image( Okular::PixmapRequest *request )
pageInfo->resolution = (double)(pageInfo->width)/ps.width().getLength_in_inch();
#if 0
kDebug(DviDebug) << *request
qCDebug(OkularDviDebug) << *request
<< ", res:" << pageInfo->resolution << " - (" << pageInfo->width << ","
<< ps.width().getLength_in_inch() << ")," << ps.width().getLength_in_mm()
<< endl;
@ -252,7 +253,7 @@ QImage DviGenerator::image( Okular::PixmapRequest *request )
if ( ! pageInfo->img.isNull() )
{
kDebug(DviDebug) << "Image OK";
qCDebug(OkularDviDebug) << "Image OK";
ret = pageInfo->img;
@ -273,7 +274,7 @@ QImage DviGenerator::image( Okular::PixmapRequest *request )
Okular::TextPage* DviGenerator::textPage( Okular::Page *page )
{
kDebug(DviDebug);
qCDebug(OkularDviDebug);
dviPageInfo *pageInfo = new dviPageInfo();
pageSize ps;
@ -317,7 +318,7 @@ Okular::TextPage *DviGenerator::extractTextFromPage( dviPageInfo *pageInfo )
TextBox curTB = *it;
#if 0
kDebug(DviDebug) << "orientation: " << orientation
qCDebug(OkularDviDebug) << "orientation: " << orientation
<< ", curTB.box: " << curTB.box
<< ", tmpRect: " << tmpRect
<< ", ( " << pageWidth << "," << pageHeight << " )"
@ -497,7 +498,7 @@ void DviGenerator::loadPages( QVector< Okular::Page * > &pagesVector )
m_linkGenerated.fill( false, numofpages );
//kDebug(DviDebug) << "resolution:" << m_resolution << ", dviFile->preferred?";
//qCDebug(OkularDviDebug) << "resolution:" << m_resolution << ", dviFile->preferred?";
/* get the suggested size */
if ( m_dviRenderer->dviFile->suggestedPageSize )
@ -513,7 +514,7 @@ void DviGenerator::loadPages( QVector< Okular::Page * > &pagesVector )
for ( int i = 0; i < numofpages; ++i )
{
//kDebug(DviDebug) << "getting status of page" << i << ":";
//qCDebug(OkularDviDebug) << "getting status of page" << i << ":";
if ( pagesVector[i] )
{
@ -527,7 +528,7 @@ void DviGenerator::loadPages( QVector< Okular::Page * > &pagesVector )
pagesVector[i] = page;
}
kDebug(DviDebug) << "pagesVector successfully inizialized!";
qCDebug(OkularDviDebug) << "pagesVector successfully inizialized!";
// filling the pages with the source references rects
const QVector<DVI_SourceFileAnchor>& sourceAnchors = m_dviRenderer->sourceAnchors();
@ -598,4 +599,7 @@ QVariant DviGenerator::metaData( const QString & key, const QVariant & option )
return QVariant();
}
Q_LOGGING_CATEGORY(OkularDviDebug, "org.kde.okular.generators.dvi.core")
Q_LOGGING_CATEGORY(OkularDviShellDebug, "org.kde.okular.generators.dvi.shell")
#include "generator_dvi.moc"

View file

@ -10,7 +10,7 @@
#include <config.h>
#include "glyph.h"
#include "kvs_debug.h"
#include "debug_dvi.h"
bitmap::bitmap()
{
@ -25,7 +25,7 @@ bitmap::~bitmap()
glyph::glyph()
{
#ifdef DEBUG_GLYPH
kDebug(kvs::dvi) << "glyph::glyph()";
qCDebug(OkularDviDebug) << "glyph::glyph()";
#endif
addr = 0;

View file

@ -10,7 +10,7 @@
#ifndef _KDVI_DEBUG_H_
#define _KDVI_DEBUG_H_
#include <kdebug.h>
#include <QtCore/QDebug>
namespace kvs
{

View file

@ -10,8 +10,7 @@
#include <config.h>
#include "length.h"
#include "kvs_debug.h"
#include "debug_dvi.h"
class unitOfDistance
{
@ -66,7 +65,7 @@ float Length::convertToMM(const QString &distance, bool *ok)
// If no unit has been found -> error message, set *ok to false and
// return 0.0.
if (MMperUnit == 0.0) {
kError(kvs::shell) << "distance::convertToMM: no known unit found in the string '" << distance << "'." << endl;
qCCritical(OkularDviShellDebug) << "distance::convertToMM: no known unit found in the string '" << distance << "'." << endl;
if (ok)
*ok = false;
return 0.0;

View file

@ -9,13 +9,13 @@
#include <config.h>
#include "pageSize.h"
#include "kvs_debug.h"
#include "debug_dvi.h"
#include "length.h"
#include <kglobal.h>
#include <klocale.h>
#include <QtCore/qloggingcategory.h>
struct pageSizeItem
{
@ -117,7 +117,7 @@ bool pageSize::setPageSize(const QString& name)
currentSize = defaultPageSize();
pageWidth.setLength_in_mm(staticList[currentSize].width);
pageHeight.setLength_in_mm(staticList[currentSize].height);
kError(kvs::shell) << "pageSize::setPageSize: could not parse '" << name << "'. Using " << staticList[currentSize].name << " as a default." << endl;
qCCritical(OkularDviShellDebug) << "pageSize::setPageSize: could not parse '" << name << "'. Using " << staticList[currentSize].name << " as a default." << endl;
emit(sizeChanged(*this));
return false;
}
@ -146,7 +146,7 @@ void pageSize::setPageSize(const QString& width, const QString& _widthUnits, con
QString widthUnits = _widthUnits;
if ((widthUnits != "cm") && (widthUnits != "mm") && (widthUnits != "in")) {
kError(kvs::shell) << "Unrecognized page width unit '" << widthUnits << "'. Assuming mm" << endl;
qCCritical(OkularDviShellDebug) << "Unrecognized page width unit '" << widthUnits << "'. Assuming mm" << endl;
widthUnits = "mm";
}
pageWidth.setLength_in_mm(w);
@ -157,7 +157,7 @@ void pageSize::setPageSize(const QString& width, const QString& _widthUnits, con
QString heightUnits = _heightUnits;
if ((heightUnits != "cm") && (heightUnits != "mm") && (heightUnits != "in")) {
kError(kvs::shell) << "Unrecognized page height unit '" << widthUnits << "'. Assuming mm" << endl;
qCCritical(OkularDviShellDebug) << "Unrecognized page height unit '" << widthUnits << "'. Assuming mm" << endl;
heightUnits = "mm";
}
pageHeight.setLength_in_mm(h);
@ -269,7 +269,7 @@ QString pageSize::formatName() const
int pageSize::getOrientation() const
{
if (currentSize == -1) {
kError(kvs::shell) << "pageSize::getOrientation: getOrientation called for page format that does not have a name." << endl;
qCCritical(OkularDviShellDebug) << "pageSize::getOrientation: getOrientation called for page format that does not have a name." << endl;
return 0;
}
@ -283,7 +283,7 @@ int pageSize::getOrientation() const
void pageSize::setOrientation(int orient)
{
if (currentSize == -1) {
kError(kvs::shell) << "pageSize::setOrientation: setOrientation called for page format that does not have a name." << endl;
qCCritical(OkularDviShellDebug) << "pageSize::setOrientation: setOrientation called for page format that does not have a name." << endl;
return;
}

View file

@ -12,14 +12,16 @@
#include "psgs.h"
#include "psheader.cpp"
#include "dviFile.h"
#include "kvs_debug.h"
#include "debug_dvi.h"
#include "pageNumber.h"
#include "debug_dvi.h"
#include <klocale.h>
#include <kprocess.h>
#include <ktemporaryfile.h>
#include <kurl.h>
#include <QtCore/qloggingcategory.h>
#include <QDir>
#include <QPainter>
#include <QPixmap>
@ -65,7 +67,7 @@ ghostscript_interface::~ghostscript_interface() {
void ghostscript_interface::setPostScript(const PageNumber& page, const QString& PostScript) {
#ifdef DEBUG_PSGS
kDebug(kvs::dvi) << "ghostscript_interface::setPostScript( " << page << ", ... )";
qCDebug(OkularDviDebug) << "ghostscript_interface::setPostScript( " << page << ", ... )";
#endif
if (pageList.value(page) == 0) {
@ -89,7 +91,7 @@ void ghostscript_interface::setIncludePath(const QString &_includePath) {
void ghostscript_interface::setBackgroundColor(const PageNumber& page, const QColor& background_color, bool permanent) {
#ifdef DEBUG_PSGS
kDebug(kvs::dvi) << "ghostscript_interface::setBackgroundColor( " << page << ", " << background_color << " )";
qCDebug(OkularDviDebug) << "ghostscript_interface::setBackgroundColor( " << page << ", " << background_color << " )";
#endif
if (pageList.value(page) == 0) {
@ -111,7 +113,7 @@ void ghostscript_interface::setBackgroundColor(const PageNumber& page, const QCo
void ghostscript_interface::restoreBackgroundColor(const PageNumber& page)
{
#ifdef DEBUG_PSGS
kDebug(kvs::dvi) << "ghostscript_interface::restoreBackgroundColor( " << page << " )";
qCDebug(OkularDviDebug) << "ghostscript_interface::restoreBackgroundColor( " << page << " )";
#endif
if (pageList.value(page) == 0)
return;
@ -125,7 +127,7 @@ void ghostscript_interface::restoreBackgroundColor(const PageNumber& page)
QColor ghostscript_interface::getBackgroundColor(const PageNumber& page) const {
#ifdef DEBUG_PSGS
kDebug(kvs::dvi) << "ghostscript_interface::getBackgroundColor( " << page << " )";
qCDebug(OkularDviDebug) << "ghostscript_interface::getBackgroundColor( " << page << " )";
#endif
if (pageList.value(page) == 0)
@ -146,11 +148,11 @@ void ghostscript_interface::clear() {
void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, const QString& filename, long magnification) {
#ifdef DEBUG_PSGS
kDebug(kvs::dvi) << "ghostscript_interface::gs_generate_graphics_file( " << page << ", " << filename << " )";
qCDebug(OkularDviDebug) << "ghostscript_interface::gs_generate_graphics_file( " << page << ", " << filename << " )";
#endif
if (knownDevices.isEmpty()) {
kError(kvs::dvi) << "No known devices found" << endl;
qCCritical(OkularDviDebug) << "No known devices found" << endl;
return;
}
@ -229,7 +231,7 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, co
argus << "-f" << PSfileName;
#ifdef DEBUG_PSGS
kDebug(kvs::dvi) << argus.join(" ");
qCDebug(OkularDviDebug) << argus.join(" ");
#endif
proc << argus;
@ -238,14 +240,14 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, co
if ( res ) {
// Starting ghostscript did not work.
// TODO: Issue error message, switch PS support off.
kError(kvs::dvi) << "ghostview could not be started" << endl;
qCCritical(OkularDviDebug) << "ghostview could not be started" << endl;
}
PSfile.remove();
// Check if gs has indeed produced a file.
if (QFile::exists(filename) == false) {
kError(kvs::dvi) << "GS did not produce output." << endl;
qCCritical(OkularDviDebug) << "GS did not produce output." << endl;
// No. Check is the reason is that the device is not compiled into
// ghostscript. If so, try again with another device.
@ -254,7 +256,7 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, co
while(proc.canReadLine()) {
GSoutput = QString::fromLocal8Bit(proc.readLine());
if (GSoutput.contains("Unknown device")) {
kDebug(kvs::dvi) << QString("The version of ghostview installed on this computer does not support "
qCDebug(OkularDviDebug) << QString("The version of ghostview installed on this computer does not support "
"the '%1' ghostview device driver.").arg(*gsDevice) << endl;
knownDevices.erase(gsDevice);
gsDevice = knownDevices.begin();
@ -282,7 +284,7 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, co
"</p></qt>"));
#endif
else {
kDebug(kvs::dvi) << QString("Okular will now try to use the '%1' device driver.").arg(*gsDevice);
qCDebug(OkularDviDebug) << QString("Okular will now try to use the '%1' device driver.").arg(*gsDevice);
gs_generate_graphics_file(page, filename, magnification);
}
return;
@ -294,11 +296,11 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, co
void ghostscript_interface::graphics(const PageNumber& page, double dpi, long magnification, QPainter* paint) {
#ifdef DEBUG_PSGS
kDebug(kvs::dvi) << "ghostscript_interface::graphics( " << page << ", " << dpi << ", ... ) called.";
qCDebug(OkularDviDebug) << "ghostscript_interface::graphics( " << page << ", " << dpi << ", ... ) called.";
#endif
if (paint == 0) {
kError(kvs::dvi) << "ghostscript_interface::graphics(PageNumber page, double dpi, long magnification, QPainter *paint) called with paint == 0" << endl;
qCCritical(OkularDviDebug) << "ghostscript_interface::graphics(PageNumber page, double dpi, long magnification, QPainter *paint) called with paint == 0" << endl;
return;
}
@ -312,7 +314,7 @@ void ghostscript_interface::graphics(const PageNumber& page, double dpi, long ma
// No PostScript? Then return immediately.
if ((info == 0) || (info->PostScriptString->isEmpty())) {
#ifdef DEBUG_PSGS
kDebug(kvs::dvi) << "No PostScript found. Not drawing anything.";
qCDebug(OkularDviDebug) << "No PostScript found. Not drawing anything.";
#endif
return;
}

View file

@ -9,15 +9,16 @@
#include <config.h>
#include "simplePageSize.h"
#include "kvs_debug.h"
#include "debug_dvi.h"
#include <QtCore/qloggingcategory.h>
#include <QPaintDevice>
double SimplePageSize::zoomForHeight(quint32 height, const QPaintDevice& pd) const
{
if (!isValid()) {
kError(kvs::shell) << "SimplePageSize::zoomForHeight() called when paper height was invalid" << endl;
qCCritical(OkularDviShellDebug) << "SimplePageSize::zoomForHeight() called when paper height was invalid" << endl;
return 0.1;
}
@ -28,7 +29,7 @@ double SimplePageSize::zoomForHeight(quint32 height, const QPaintDevice& pd) con
double SimplePageSize::zoomForWidth(quint32 width, const QPaintDevice& pd) const
{
if (!isValid()) {
kError(kvs::shell) << "SimplePageSize::zoomForWidth() called when paper width was invalid" << endl;
qCCritical(OkularDviShellDebug) << "SimplePageSize::zoomForWidth() called when paper width was invalid" << endl;
return 0.1;
}
@ -39,7 +40,7 @@ double SimplePageSize::zoomForWidth(quint32 width, const QPaintDevice& pd) const
double SimplePageSize::zoomToFitInto(const SimplePageSize &target) const
{
if (!isValid() || isSmall() || !target.isValid()) {
kWarning(kvs::shell) << "SimplePageSize::zoomToFitInto(...) with unsuitable source of target" ;
qCWarning(OkularDviShellDebug) << "SimplePageSize::zoomToFitInto(...) with unsuitable source of target" ;
return 1.0;
}

View file

@ -12,7 +12,7 @@
#include "dviFile.h"
#include "dviRenderer.h"
#include "hyperlink.h"
#include "kvs_debug.h"
#include "debug_dvi.h"
#include "psgs.h"
//#include "renderedDocumentPage.h"
@ -23,18 +23,16 @@
#include <QFile>
#include <QImage>
#include <QPainter>
//#define DEBUG_SPECIAL
#include "debug_dvi.h"
void dviRenderer::printErrorMsgForSpecials(const QString& msg)
{
if (dviFile->errorCounter < 25) {
kError(kvs::dvi) << msg << endl;
qCCritical(OkularDviDebug) << msg << endl;
dviFile->errorCounter++;
if (dviFile->errorCounter == 25)
kError(kvs::dvi) << i18n("That makes 25 errors. Further error messages will not be printed.") << endl;
qCCritical(OkularDviDebug) << i18n("That makes 25 errors. Further error messages will not be printed.") << endl;
}
}
@ -251,7 +249,7 @@ void dviRenderer::html_href_special(const QString& _cp)
cp.truncate(cp.indexOf('"'));
#ifdef DEBUG_SPECIAL
kDebug(kvs::dvi) << "HTML-special, href " << cp.toLatin1();
qCDebug(OkularDviDebug) << "HTML-special, href " << cp.toLatin1();
#endif
HTML_href = new QString(cp);
}
@ -260,7 +258,7 @@ void dviRenderer::html_href_special(const QString& _cp)
void dviRenderer::html_anchor_end()
{
#ifdef DEBUG_SPECIAL
kDebug(kvs::dvi) << "HTML-special, anchor-end";
qCDebug(OkularDviDebug) << "HTML-special, anchor-end";
#endif
if (HTML_href != NULL) {
@ -300,7 +298,7 @@ void parse_special_argument(const QString& strg, const char* argument_name, int*
*variable = int(tmp_float+0.5);
else
// Maybe we should open a dialog here.
kError(kvs::dvi) << i18n("Malformed parameter in the epsf special command.\n"
qCCritical(OkularDviDebug) << i18n("Malformed parameter in the epsf special command.\n"
"Expected a float to follow %1 in %2",
argument_name, strg) << endl;
}
@ -310,7 +308,7 @@ void parse_special_argument(const QString& strg, const char* argument_name, int*
void dviRenderer::epsf_special(const QString& cp)
{
#ifdef DEBUG_SPECIAL
kDebug(kvs::dvi) << "epsf-special: psfile=" << cp;
qCDebug(OkularDviDebug) << "epsf-special: psfile=" << cp;
#endif
QString include_command = cp.simplified();
@ -438,7 +436,7 @@ void dviRenderer::epsf_special(const QString& cp)
void dviRenderer::TPIC_flushPath_special()
{
#ifdef DEBUG_SPECIAL
kDebug(kvs::dvi) << "TPIC special flushPath";
qCDebug(OkularDviDebug) << "TPIC special flushPath";
#endif
if (number_of_elements_in_path == 0) {
@ -456,7 +454,7 @@ void dviRenderer::TPIC_flushPath_special()
void dviRenderer::TPIC_addPath_special(const QString& cp)
{
#ifdef DEBUG_SPECIAL
kDebug(kvs::dvi) << "TPIC special addPath: " << cp;
qCDebug(OkularDviDebug) << "TPIC special addPath: " << cp;
#endif
// Adds a point to the path list
@ -490,7 +488,7 @@ void dviRenderer::TPIC_addPath_special(const QString& cp)
void dviRenderer::TPIC_setPen_special(const QString& cp)
{
#ifdef DEBUG_SPECIAL
kDebug(kvs::dvi) << "TPIC special setPen: " << cp;
qCDebug(OkularDviDebug) << "TPIC special setPen: " << cp;
#endif
// Sets the pen size in milli-inches

View file

@ -52,14 +52,16 @@
#include <config.h>
#include "kvs_debug.h"
#include "debug_dvi.h"
#include "xdvi.h"
#include "debug_dvi.h"
#include <klocale.h>
#include <kmessagebox.h>
#include <cstdlib>
#include <QtCore/qloggingcategory.h>
/*
* General utility routines.
@ -71,7 +73,7 @@
void oops(const QString& message)
{
kError(kvs::dvi) << "Fatal Error:" << message << endl;
qCCritical(OkularDviDebug) << "Fatal Error:" << message << endl;
KMessageBox::error( NULL,
i18n("Fatal error.\n\n") +

View file

@ -26,9 +26,10 @@
#include <config.h>
#include "debug_dvi.h"
#include "dvi.h"
#include "dviRenderer.h"
#include "kvs_debug.h"
#include "debug_dvi.h"
#include "xdvi.h"
#include <klocale.h>
@ -68,7 +69,7 @@ extern void oops(const QString& message);
void TeXFontDefinition::read_VF_index()
{
#ifdef DEBUG_FONTS
kDebug(kvs::dvi) << "font::read_VF_index()";
qCDebug(OkularDviDebug) << "font::read_VF_index()";
#endif
FILE *VF_file = file;
unsigned char cmnd;
@ -78,14 +79,14 @@ void TeXFontDefinition::read_VF_index()
flags |= FONT_VIRTUAL;
set_char_p = &dviRenderer::set_vf_char;
#ifdef DEBUG_FONTS
kDebug(kvs::dvi) << "TeXFontDefinition::read_VF_index: reading VF pixel file " << filename;
qCDebug(OkularDviDebug) << "TeXFontDefinition::read_VF_index: reading VF pixel file " << filename;
#endif
// Read preamble.
fseek(VF_file, (long) one(VF_file), 1); /* skip comment */
quint32 const file_checksum = four(VF_file);
if (file_checksum && checksum && file_checksum != checksum)
kError(kvs::dvi) << "Checksum mismatch dvi = " << checksum << "u, vf = " << file_checksum <<
qCCritical(OkularDviDebug) << "Checksum mismatch dvi = " << checksum << "u, vf = " << file_checksum <<
"u) in font file" << filename << endl;
(void) four(VF_file); /* skip design size */
@ -103,7 +104,7 @@ void TeXFontDefinition::read_VF_index()
fontname[len] = '\0';
#ifdef DEBUG_FONTS
kDebug(kvs::dvi) << "Virtual font defines subfont \"" << fontname << "\" scale=" << scale << " design=" << design;
qCDebug(OkularDviDebug) << "Virtual font defines subfont \"" << fontname << "\" scale=" << scale << " design=" << design;
#endif
// According to Knuth's documentation found in the web source code
@ -131,7 +132,7 @@ void TeXFontDefinition::read_VF_index()
// Prepare macro array.
macrotable = new macro[max_num_of_chars_in_font];
if (macrotable == 0) {
kError(kvs::dvi) << "Could not allocate memory for a macro table.";
qCCritical(OkularDviDebug) << "Could not allocate memory for a macro table.";
exit(0);
}
@ -148,7 +149,7 @@ void TeXFontDefinition::read_VF_index()
cc = four(VF_file);
width = four(VF_file);
if (cc >= 256) {
kError(kvs::dvi) << "Virtual character" << cc << "in font"
qCCritical(OkularDviDebug) << "Virtual character" << cc << "in font"
<< fontname << "ignored.";
fseek(VF_file, (long) len, 1);
continue;

View file

@ -16,7 +16,7 @@
#include <QFileInfo>
#include <QApplication> // Because of the HACK
#include <kdebug.h>
#include <QtCore/QDebug>
#include <klocale.h>
#include <KStandardDirs>

View file

@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
#include <stdio.h>
#include <sys/types.h>
#include <kdebug.h>
#include <QtCore/QDebug>
#include "faxexpand.h"

View file

@ -12,7 +12,7 @@
#include <QtGui/QColor>
#include <QtCore/QFile>
#include <QtCore/QRegExp>
#include <kdebug.h>
#include <QtCore/QDebug>
#include <QApplication> // Because of the HACK
#include <QPalette> // Because of the HACK

View file

@ -11,12 +11,14 @@
#include <poppler-annotation.h>
// qt/kde includes
#include <QtCore/qloggingcategory.h>
#include <qvariant.h>
#include <core/annotations.h>
#include <core/area.h>
#include "annots.h"
#include "debug_pdf.h"
#include "generator_pdf.h"
#include "popplerembeddedfile.h"
#include "config-okular-poppler.h"
@ -124,7 +126,7 @@ void PopplerAnnotationProxy::notifyAddition( Okular::Annotation *okl_ann, int pa
okl_ann->setNativeId( qVariantFromValue( ppl_ann ) );
okl_ann->setDisposeDataFunction( disposeAnnotation );
kDebug(PDFGenerator::PDFDebug) << okl_ann->uniqueName();
qCDebug(OkularPdfDebug) << okl_ann->uniqueName();
}
void PopplerAnnotationProxy::notifyModification( const Okular::Annotation *okl_ann, int page, bool appearanceChanged )
@ -232,11 +234,11 @@ void PopplerAnnotationProxy::notifyModification( const Okular::Annotation *okl_a
break;
}
default:
kDebug() << "Type-specific property modification is not implemented for this annotation type";
qCDebug(OkularPdfDebug) << "Type-specific property modification is not implemented for this annotation type";
break;
}
kDebug(PDFGenerator::PDFDebug) << okl_ann->uniqueName();
qCDebug(OkularPdfDebug) << okl_ann->uniqueName();
}
void PopplerAnnotationProxy::notifyRemoval( Okular::Annotation *okl_ann, int page )
@ -254,7 +256,7 @@ void PopplerAnnotationProxy::notifyRemoval( Okular::Annotation *okl_ann, int pag
okl_ann->setNativeId( qVariantFromValue(0) ); // So that we don't double-free in disposeAnnotation
kDebug(PDFGenerator::PDFDebug) << okl_ann->uniqueName();
qCDebug(OkularPdfDebug) << okl_ann->uniqueName();
}
//END PopplerAnnotationProxy implementation

View file

@ -0,0 +1,17 @@
/***************************************************************************
* 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. *
***************************************************************************/
#ifndef OKULAR_DEBUG_P_H
#define OKULAR_DEBUG_P_H
#include <QtCore/qloggingcategory.h>
Q_DECLARE_LOGGING_CATEGORY(OkularPdfDebug)
#endif

View file

@ -29,7 +29,7 @@
#include <klocale.h>
#include <kmessagebox.h>
#include <ktemporaryfile.h>
#include <kdebug.h>
#include <QtCore/QDebug>
#include <kglobal.h>
#include <core/action.h>
@ -50,6 +50,7 @@
#include <poppler-media.h>
#include "debug_pdf.h"
#include "annots.h"
#include "formfields.h"
#include "popplerembeddedfile.h"
@ -396,7 +397,7 @@ OKULAR_EXPORT_PLUGIN(PDFGenerator, createAboutData())
static void PDFGeneratorPopplerDebugFunction(const QString &message, const QVariant &closure)
{
Q_UNUSED(closure);
kDebug() << "[Poppler]" << message;
qCDebug(OkularPdfDebug) << "[Poppler]" << message;
}
PDFGenerator::PDFGenerator( QObject *parent, const QVariantList &args )
@ -434,7 +435,7 @@ Okular::Document::OpenResult PDFGenerator::loadDocumentWithPassword( const QStri
#ifndef NDEBUG
if ( pdfdoc )
{
kDebug(PDFDebug) << "PDFGenerator: multiple calls to loadDocument. Check it.";
qCDebug(OkularPdfDebug) << "PDFGenerator: multiple calls to loadDocument. Check it.";
return Okular::Document::OpenError;
}
#endif
@ -459,7 +460,7 @@ Okular::Document::OpenResult PDFGenerator::loadDocumentFromDataWithPassword( con
#ifndef NDEBUG
if ( pdfdoc )
{
kDebug(PDFDebug) << "PDFGenerator: multiple calls to loadDocument. Check it.";
qCDebug(OkularPdfDebug) << "PDFGenerator: multiple calls to loadDocument. Check it.";
return Okular::Document::OpenError;
}
#endif
@ -580,7 +581,7 @@ void PDFGenerator::loadPages(QVector<Okular::Page*> &pagesVector, int rotation,
// kWarning(PDFDebug).nospace() << page->width() << "x" << page->height();
#ifdef PDFGENERATOR_DEBUG
kDebug(PDFDebug) << "load page" << i << "with rotation" << rotation << "and orientation" << orientation;
qCDebug(OkularPdfDebug) << "load page" << i << "with rotation" << rotation << "and orientation" << orientation;
#endif
delete p;
@ -800,7 +801,7 @@ bool PDFGenerator::isAllowed( Okular::Permission permission ) const
QImage PDFGenerator::image( Okular::PixmapRequest * request )
{
// 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 << "].";
//qCDebug(OkularPdfDebug) << "id: " << request->id << " is requesting " << (request->async ? "ASYNC" : "sync") << " pixmap for page " << request->page->number() << " [" << request->width << " x " << request->height << "].";
// compute dpi used to get an image with desired width and height
Okular::Page * page = request->page();
@ -931,7 +932,7 @@ void PDFGenerator::resolveMediaLinkReferences( Okular::Page *page )
Okular::TextPage* PDFGenerator::textPage( Okular::Page *page )
{
#ifdef PDFGENERATOR_DEBUG
kDebug(PDFDebug) << "page" << page->number();
qCDebug(OkularPdfDebug) << "page" << page->number();
#endif
// build a TextList...
QList<Poppler::TextBox*> textList;
@ -1282,7 +1283,7 @@ Okular::TextPage * PDFGenerator::abstractTextPage(const QList<Poppler::TextBox*>
Okular::TextPage* ktp=new Okular::TextPage;
Poppler::TextBox *next;
#ifdef PDFGENERATOR_DEBUG
kDebug(PDFDebug) << "getting text page in generator pdf - rotation:" << rot;
qCDebug(OkularPdfDebug) << "getting text page in generator pdf - rotation:" << rot;
#endif
QString s;
bool addChar;
@ -1613,7 +1614,7 @@ void PDFGenerator::loadPdfSync( const QString & filePath, QVector<Okular::Page*>
else if ( tokens.first() == QLatin1String( "p*" ) && tokenSize >= 4 )
{
// TODO
kDebug(PDFDebug) << "PdfSync: 'p*' line ignored";
qCDebug(OkularPdfDebug) << "PdfSync: 'p*' line ignored";
}
else if ( tokens.first() == QLatin1String( "p" ) && tokenSize >= 4 )
{
@ -1644,10 +1645,10 @@ void PDFGenerator::loadPdfSync( const QString & filePath, QVector<Okular::Page*>
fileStack.pop();
}
else
kDebug(PDFDebug) << "PdfSync: going one level down too much";
qCDebug(OkularPdfDebug) << "PdfSync: going one level down too much";
}
else
kDebug(PDFDebug).nospace() << "PdfSync: unknown line format: '" << line << "'";
qCDebug(OkularPdfDebug).nospace() << "PdfSync: unknown line format: '" << line << "'";
}
@ -1828,4 +1829,6 @@ Okular::AnnotationProxy* PDFGenerator::annotationProxy() const
#include "generator_pdf.moc"
Q_LOGGING_CATEGORY(OkularPdfDebug, "org.kde.okular.generators.pdf")
/* kate: replace-tabs on; indent-width 4; */

View file

@ -19,7 +19,7 @@
#include <kaboutdata.h>
#include <kconfigdialog.h>
#include <kdebug.h>
#include <QtCore/QDebug>
#include <QMimeType>
#include <QMimeDatabase>
#include <ktemporaryfile.h>

View file

@ -11,7 +11,7 @@
#include <qimage.h>
#include <kdebug.h>
#include <QtCore/QDebug>
#include "core/generator.h"
#include "core/page.h"

View file

@ -19,7 +19,7 @@
#include <QtPrintSupport/QPrinter>
#include <kaboutdata.h>
#include <kdebug.h>
#include <QtCore/QDebug>
#include <kglobal.h>
#include <klocale.h>
@ -445,11 +445,13 @@ int TIFFGenerator::mapPage( int page ) const
QHash< int, int >::const_iterator it = m_pageMapping.find( page );
if ( it == m_pageMapping.end() )
{
kWarning(TiffDebug) << "Requesting unmapped page" << page << ":" << m_pageMapping;
qCWarning(OkularTiffDebug) << "Requesting unmapped page" << page << ":" << m_pageMapping;
return -1;
}
return it.value();
}
Q_LOGGING_CATEGORY(OkularTiffDebug, "org.kde.okular.generators.tiff")
#include "generator_tiff.moc"

View file

@ -12,6 +12,7 @@
#include <core/generator.h>
#include <QtCore/qloggingcategory.h>
#include <qhash.h>
class TIFFGenerator : public Okular::Generator
@ -43,4 +44,6 @@ class TIFFGenerator : public Okular::Generator
QHash< int, int > m_pageMapping;
};
Q_DECLARE_LOGGING_CATEGORY(OkularTiffDebug)
#endif

View file

@ -0,0 +1,18 @@
/***************************************************************************
* Copyright (C) 2006 by Luigi Toscano <luigi.toscano@tiscali.it> *
* 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. *
***************************************************************************/
#ifndef OKULAR_TXT_DEBUG_P_H
#define OKULAR_TXT_DEBUG_P_H
#include <QtCore/qloggingcategory.h>
Q_DECLARE_LOGGING_CATEGORY(OkularTxtDebug)
#endif

View file

@ -13,22 +13,23 @@
#include <QTextCodec>
#include <kencodingprober.h>
#include <kdebug.h>
#include <QtCore/QDebug>
#include "document.h"
#include "debug_txt.h"
using namespace Txt;
Document::Document( const QString &fileName )
{
#ifdef TXT_DEBUG
kDebug() << "Opening file" << fileName;
qCDebug(OkularTxtDebug) << "Opening file" << fileName;
#endif
QFile plainFile( fileName );
if ( !plainFile.open( QIODevice::ReadOnly | QIODevice::Text ) )
{
kDebug() << "Can't open file" << plainFile.fileName();
qCDebug(OkularTxtDebug) << "Can't open file" << plainFile.fileName();
return;
}
@ -65,7 +66,9 @@ QString Document::toUnicode( const QByteArray &array )
return QString();
}
kDebug() << "Detected" << prober.encoding() << "encoding"
qCDebug(OkularTxtDebug) << "Detected" << prober.encoding() << "encoding"
<< "based on" << charsFeeded << "chars";
return QTextCodec::codecForName( encoding )->toUnicode( array );
}
Q_LOGGING_CATEGORY(OkularTxtDebug, "org.kde.okular.generators.txt")

View file

@ -268,7 +268,7 @@ static QPainterPath parseAbbreviatedPathData( const QString &data)
{
if (token.type != abtEOF)
{
kDebug(XpsDebug).nospace() << "Error in parsing abbreviated path data (" << token.type << "@" << token.curPos << "): " << data;
qCWarning(OkularXpsDebug).nospace() << "Error in parsing abbreviated path data (" << token.type << "@" << token.curPos << "): " << data;
}
return path;
}
@ -414,7 +414,7 @@ static QBrush parseRscRefColorForBrush( const QString &data )
{
if (data[0] == '{') {
//TODO
kDebug(XpsDebug) << "Reference" << data;
qCWarning(OkularXpsDebug) << "Reference" << data;
return QBrush();
} else {
return QBrush( hexToRgba( data.toLatin1() ) );
@ -428,7 +428,7 @@ static QPen parseRscRefColorForPen( const QString &data )
{
if (data[0] == '{') {
//TODO
kDebug(XpsDebug) << "Reference" << data;
qCWarning(OkularXpsDebug) << "Reference" << data;
return QPen();
} else {
return QPen( hexToRgba( data.toLatin1() ) );
@ -442,7 +442,7 @@ static QTransform parseRscRefMatrix( const QString &data )
{
if (data[0] == '{') {
//TODO
kDebug(XpsDebug) << "Reference" << data;
qCWarning(OkularXpsDebug) << "Reference" << data;
return QTransform();
} else {
return attsToMatrix( data );
@ -456,7 +456,7 @@ static QPainterPath parseRscRefPath( const QString &data )
{
if (data[0] == '{') {
//TODO
kDebug(XpsDebug) << "Reference" << data;
qCWarning(OkularXpsDebug) << "Reference" << data;
return QPainterPath();
} else {
return parseAbbreviatedPathData( data );
@ -753,7 +753,7 @@ XpsHandler::~XpsHandler()
bool XpsHandler::startDocument()
{
kDebug(XpsDebug) << "start document" << m_page->m_fileName ;
qCWarning(OkularXpsDebug) << "start document" << m_page->m_fileName ;
XpsRenderNode node;
node.name = "document";
@ -790,7 +790,7 @@ bool XpsHandler::endElement( const QString &nameSpace,
XpsRenderNode node = m_nodes.pop();
if (node.name != localName) {
kDebug(XpsDebug) << "Name doesn't match";
qCWarning(OkularXpsDebug) << "Name doesn't match";
}
processEndElement( node );
node.children.clear();
@ -813,7 +813,7 @@ void XpsHandler::processGlyph( XpsRenderNode &node )
// Get font (doesn't work well because qt doesn't allow to load font from file)
// This works despite the fact that font size isn't specified in points as required by qt. It's because I set point size to be equal to drawing unit.
float fontSize = node.attributes.value("FontRenderingEmSize").toFloat();
// kDebug(XpsDebug) << "Font Rendering EmSize:" << fontSize;
// qCWarning(OkularXpsDebug) << "Font Rendering EmSize:" << fontSize;
// a value of 0.0 means the text is not visible (see XPS specs, chapter 12, "Glyphs")
if ( fontSize < 0.1 ) {
m_painter->restore();
@ -916,7 +916,7 @@ void XpsHandler::processGlyph( XpsRenderNode &node )
advanceWidths.append( AdvanceWidth + uOffset );
} else {
// has vertical offset, but don't know how to handle that yet
kDebug(XpsDebug) << "Unhandled Indices element: " << indicesElements.at(i);
qCWarning(OkularXpsDebug) << "Unhandled Indices element: " << indicesElements.at(i);
advanceWidths.append( -1.0 );
}
} else {
@ -940,9 +940,9 @@ void XpsHandler::processGlyph( XpsRenderNode &node )
originAdvance.rx() += metrics.width( thisChar );
}
}
// kDebug(XpsDebug) << "Glyphs: " << atts.value("Fill") << ", " << atts.value("FontUri");
// kDebug(XpsDebug) << " Origin: " << atts.value("OriginX") << "," << atts.value("OriginY");
// kDebug(XpsDebug) << " Unicode: " << atts.value("UnicodeString");
// qCWarning(OkularXpsDebug) << "Glyphs: " << atts.value("Fill") << ", " << atts.value("FontUri");
// qCWarning(OkularXpsDebug) << " Origin: " << atts.value("OriginX") << "," << atts.value("OriginY");
// qCWarning(OkularXpsDebug) << " Unicode: " << atts.value("UnicodeString");
m_painter->restore();
}
@ -952,7 +952,7 @@ void XpsHandler::processFill( XpsRenderNode &node )
//TODO Ignored child elements: VirtualBrush
if (node.children.size() != 1) {
kDebug(XpsDebug) << "Fill element should have exactly one child";
qCWarning(OkularXpsDebug) << "Fill element should have exactly one child";
} else {
node.data = node.children[0].data;
}
@ -963,7 +963,7 @@ void XpsHandler::processStroke( XpsRenderNode &node )
//TODO Ignored child elements: VirtualBrush
if (node.children.size() != 1) {
kDebug(XpsDebug) << "Stroke element should have exactly one child";
qCWarning(OkularXpsDebug) << "Stroke element should have exactly one child";
} else {
node.data = node.children[0].data;
}
@ -1152,7 +1152,7 @@ void XpsHandler::processPath( XpsRenderNode &node )
void XpsHandler::processPathData( XpsRenderNode &node )
{
if (node.children.size() != 1) {
kDebug(XpsDebug) << "Path.Data element should have exactly one child";
qCWarning(OkularXpsDebug) << "Path.Data element should have exactly one child";
} else {
node.data = node.children[0].data;
}
@ -1394,7 +1394,7 @@ void XpsHandler::processEndElement( XpsRenderNode &node )
} else if (node.name == "Path.Data") {
processPathData( node );
} else {
//kDebug(XpsDebug) << "Unknown element: " << node->name;
//qCWarning(OkularXpsDebug) << "Unknown element: " << node->name;
}
}
@ -1403,7 +1403,7 @@ XpsPage::XpsPage(XpsFile *file, const QString &fileName): m_file( file ),
{
m_pageImage = NULL;
// kDebug(XpsDebug) << "page file name: " << fileName;
// qCWarning(OkularXpsDebug) << "page file name: " << fileName;
const KZipFileEntry* pageFile = static_cast<const KZipFileEntry *>(m_file->xpsArchive()->directory()->entry( fileName ));
@ -1422,7 +1422,7 @@ XpsPage::XpsPage(XpsFile *file, const QString &fileName): m_file( file ),
}
if ( xml.error() )
{
kDebug(XpsDebug) << "Could not parse XPS page:" << xml.errorString();
qCWarning(OkularXpsDebug) << "Could not parse XPS page:" << xml.errorString();
}
}
@ -1468,7 +1468,7 @@ bool XpsPage::renderToPainter( QPainter *painter )
QBuffer buffer( &data );
QXmlInputSource source( &buffer );
bool ok = parser.parse( source );
kDebug(XpsDebug) << "Parse result: " << ok;
qCWarning(OkularXpsDebug) << "Parse result: " << ok;
return true;
}
@ -1480,7 +1480,7 @@ QSizeF XpsPage::size() const
QFont XpsFile::getFontByName( const QString &fileName, float size )
{
// kDebug(XpsDebug) << "trying to get font: " << fileName << ", size: " << size;
// qCWarning(OkularXpsDebug) << "trying to get font: " << fileName << ", size: " << size;
int index = m_fontCache.value(fileName, -1);
if (index == -1)
@ -1489,19 +1489,19 @@ QFont XpsFile::getFontByName( const QString &fileName, float size )
m_fontCache[fileName] = index;
}
if ( index == -1 ) {
kWarning(XpsDebug) << "Requesting uknown font:" << fileName;
qCWarning(OkularXpsDebug) << "Requesting uknown font:" << fileName;
return QFont();
}
const QStringList fontFamilies = m_fontDatabase.applicationFontFamilies( index );
if ( fontFamilies.isEmpty() ) {
kWarning(XpsDebug) << "The unexpected has happened. No font family for a known font:" << fileName << index;
qCWarning(OkularXpsDebug) << "The unexpected has happened. No font family for a known font:" << fileName << index;
return QFont();
}
const QString fontFamily = fontFamilies[0];
const QStringList fontStyles = m_fontDatabase.styles( fontFamily );
if ( fontStyles.isEmpty() ) {
kWarning(XpsDebug) << "The unexpected has happened. No font style for a known font family:" << fileName << index << fontFamily ;
qCWarning(OkularXpsDebug) << "The unexpected has happened. No font style for a known font family:" << fileName << index << fontFamily ;
return QFont();
}
const QString fontStyle = fontStyles[0];
@ -1510,7 +1510,7 @@ QFont XpsFile::getFontByName( const QString &fileName, float size )
int XpsFile::loadFontByName( const QString &fileName )
{
// kDebug(XpsDebug) << "font file name: " << fileName;
// qCWarning(OkularXpsDebug) << "font file name: " << fileName;
const KArchiveEntry* fontFile = loadEntry( m_xpsArchive, fileName, Qt::CaseInsensitive );
if ( !fontFile ) {
@ -1529,13 +1529,13 @@ int XpsFile::loadFontByName( const QString &fileName )
unsigned short guid[16];
if (!parseGUID(baseName, guid))
{
kDebug(XpsDebug) << "File to load font - file name isn't a GUID";
qCWarning(OkularXpsDebug) << "File to load font - file name isn't a GUID";
}
else
{
if (fontData.length() < 32)
{
kDebug(XpsDebug) << "Font file is too small";
qCWarning(OkularXpsDebug) << "Font file is too small";
} else {
// Obfuscation - xor bytes in font binary with bytes from guid (font's filename)
const static int mapping[] = {15, 14, 13, 12, 11, 10, 9, 8, 6, 7, 4, 5, 0, 1, 2, 3};
@ -1549,7 +1549,7 @@ int XpsFile::loadFontByName( const QString &fileName )
}
// kDebug(XpsDebug) << "Loaded font: " << m_fontDatabase.applicationFontFamilies( result );
// qCWarning(OkularXpsDebug) << "Loaded font: " << m_fontDatabase.applicationFontFamilies( result );
return result; // a font ID
}
@ -1560,7 +1560,7 @@ KZip * XpsFile::xpsArchive() {
QImage XpsPage::loadImageFromFile( const QString &fileName )
{
// kDebug(XpsDebug) << "image file name: " << fileName;
// qCWarning(OkularXpsDebug) << "image file name: " << fileName;
if ( fileName.at( 0 ) == QLatin1Char( '{' ) ) {
// for example: '{ColorConvertedBitmap /Resources/bla.wdp /Resources/foobar.icc}'
@ -1607,7 +1607,7 @@ QImage XpsPage::loadImageFromFile( const QString &fileName )
Okular::TextPage* XpsPage::textPage()
{
// kDebug(XpsDebug) << "Parsing XpsPage, text extraction";
// qCWarning(OkularXpsDebug) << "Parsing XpsPage, text extraction";
Okular::TextPage* textPage = new Okular::TextPage();
@ -1649,7 +1649,7 @@ Okular::TextPage* XpsPage::textPage()
} else if ( (xml.name() == "FixedPage") || (xml.name() == "FixedPage.Resources") ) {
// not useful for text extraction
} else {
kDebug(XpsDebug) << "Unhandled element in Text Extraction start: " << xml.name().toString();
qCWarning(OkularXpsDebug) << "Unhandled element in Text Extraction start: " << xml.name().toString();
}
} else if (xml.isEndElement() ) {
if (xml.name() == "Canvas") {
@ -1698,19 +1698,19 @@ Okular::TextPage* XpsPage::textPage()
} else if ( (xml.name() == "FixedPage") || (xml.name() == "FixedPage.Resources") ) {
// not useful for text extraction
} else {
kDebug(XpsDebug) << "Unhandled element in Text Extraction end: " << xml.name().toString();
qCWarning(OkularXpsDebug) << "Unhandled element in Text Extraction end: " << xml.name().toString();
}
}
}
if ( xml.error() ) {
kDebug(XpsDebug) << "Error parsing XpsPage text: " << xml.errorString();
qCWarning(OkularXpsDebug) << "Error parsing XpsPage text: " << xml.errorString();
}
return textPage;
}
void XpsDocument::parseDocumentStructure( const QString &documentStructureFileName )
{
kDebug(XpsDebug) << "document structure file name: " << documentStructureFileName;
qCWarning(OkularXpsDebug) << "document structure file name: " << documentStructureFileName;
m_haveDocumentStructure = false;
const KZipFileEntry* documentStructureFile = static_cast<const KZipFileEntry *>(m_file->xpsArchive()->directory()->entry( documentStructureFileName ));
@ -1726,9 +1726,9 @@ void XpsDocument::parseDocumentStructure( const QString &documentStructureFileNa
if ( xml.name() == "DocumentStructure" ) {
// just a container for optional outline and story elements - nothing to do here
} else if ( xml.name() == "DocumentStructure.Outline" ) {
kDebug(XpsDebug) << "found DocumentStructure.Outline";
qCWarning(OkularXpsDebug) << "found DocumentStructure.Outline";
} else if ( xml.name() == "DocumentOutline" ) {
kDebug(XpsDebug) << "found DocumentOutline";
qCWarning(OkularXpsDebug) << "found DocumentOutline";
m_docStructure = new Okular::DocumentSynopsis;
} else if ( xml.name() == "OutlineEntry" ) {
m_haveDocumentStructure = true;
@ -1740,12 +1740,12 @@ void XpsDocument::parseDocumentStructure( const QString &documentStructureFileNa
QString target = attributes.value("OutlineTarget").toString();
int hashPosition = target.lastIndexOf( '#' );
target = target.mid( hashPosition + 1 );
// kDebug(XpsDebug) << "target: " << target;
// qCWarning(OkularXpsDebug) << "target: " << target;
Okular::DocumentViewport viewport;
viewport.pageNumber = m_docStructurePageMap.value( target );
synopsisElement.setAttribute( "Viewport", viewport.toString() );
if ( outlineLevel == 1 ) {
// kDebug(XpsDebug) << "Description: "
// qCWarning(OkularXpsDebug) << "Description: "
// << outlineEntryElement.attribute( "Description" ) << endl;
m_docStructure->appendChild( synopsisElement );
} else {
@ -1769,7 +1769,7 @@ void XpsDocument::parseDocumentStructure( const QString &documentStructureFileNa
} else if ( xml.name() == "StoryFragmentReference" ) {
// we need to handle StoryFragmentReference here, but I have no idea what to do with it.
} else {
kDebug(XpsDebug) << "Unhandled entry in DocumentStructure: " << xml.name().toString();
qCWarning(OkularXpsDebug) << "Unhandled entry in DocumentStructure: " << xml.name().toString();
}
}
}
@ -1787,7 +1787,7 @@ bool XpsDocument::hasDocumentStructure()
XpsDocument::XpsDocument(XpsFile *file, const QString &fileName): m_file(file), m_haveDocumentStructure( false ), m_docStructure( 0 )
{
kDebug(XpsDebug) << "document file name: " << fileName;
qCWarning(OkularXpsDebug) << "document file name: " << fileName;
const KArchiveEntry* documentEntry = file->xpsArchive()->directory()->entry( fileName );
QString documentFilePath = fileName;
@ -1800,7 +1800,7 @@ XpsDocument::XpsDocument(XpsFile *file, const QString &fileName): m_file(file),
if ( docXml.isStartElement() ) {
if ( docXml.name() == "PageContent" ) {
QString pagePath = docXml.attributes().value("Source").toString();
kDebug(XpsDebug) << "Page Path: " << pagePath;
qCWarning(OkularXpsDebug) << "Page Path: " << pagePath;
XpsPage *page = new XpsPage( file, absolutePath( documentFilePath, pagePath ) );
m_pages.append(page);
} else if ( docXml.name() == "PageContent.LinkTargets" ) {
@ -1813,12 +1813,12 @@ XpsDocument::XpsDocument(XpsFile *file, const QString &fileName): m_file(file),
} else if ( docXml.name() == "FixedDocument" ) {
// we just ignore this - it is just a container
} else {
kDebug(XpsDebug) << "Unhandled entry in FixedDocument: " << docXml.name().toString();
qCWarning(OkularXpsDebug) << "Unhandled entry in FixedDocument: " << docXml.name().toString();
}
}
}
if ( docXml.error() ) {
kDebug(XpsDebug) << "Could not parse main XPS document file: " << docXml.errorString();
qCWarning(OkularXpsDebug) << "Could not parse main XPS document file: " << docXml.errorString();
}
// There might be a relationships entry for this document - typically used to tell us where to find the
@ -1842,28 +1842,28 @@ XpsDocument::XpsDocument(XpsFile *file, const QString &fileName): m_file(file),
if ( attributes.value( "Type" ).toString() == "http://schemas.microsoft.com/xps/2005/06/documentstructure" ) {
documentStructureFile = attributes.value( "Target" ).toString();
} else {
kDebug(XpsDebug) << "Unknown document relationships element: "
qCWarning(OkularXpsDebug) << "Unknown document relationships element: "
<< attributes.value( "Type" ).toString() << " : "
<< attributes.value( "Target" ).toString() << endl;
}
}
}
if ( xml.error() ) {
kDebug(XpsDebug) << "Could not parse XPS page relationships file ( "
qCWarning(OkularXpsDebug) << "Could not parse XPS page relationships file ( "
<< documentRelationshipFile
<< " ) - " << xml.errorString() << endl;
}
} else { // the page relationship file didn't exist in the zipfile
// this isn't fatal
kDebug(XpsDebug) << "Could not open Document relationship file from " << documentRelationshipFile;
qCWarning(OkularXpsDebug) << "Could not open Document relationship file from " << documentRelationshipFile;
}
if ( ! documentStructureFile.isEmpty() )
{
// kDebug(XpsDebug) << "Document structure filename: " << documentStructureFile;
// qCWarning(OkularXpsDebug) << "Document structure filename: " << documentStructureFile;
// make the document path absolute
documentStructureFile = absolutePath( documentEntryPath, documentStructureFile );
// kDebug(XpsDebug) << "Document structure absolute path: " << documentStructureFile;
// qCWarning(OkularXpsDebug) << "Document structure absolute path: " << documentStructureFile;
parseDocumentStructure( documentStructureFile );
}
@ -1906,9 +1906,9 @@ bool XpsFile::loadDocument(const QString &filename)
{
m_xpsArchive = new KZip( filename );
if ( m_xpsArchive->open( QIODevice::ReadOnly ) == true ) {
kDebug(XpsDebug) << "Successful open of " << m_xpsArchive->fileName();
qCWarning(OkularXpsDebug) << "Successful open of " << m_xpsArchive->fileName();
} else {
kDebug(XpsDebug) << "Could not open XPS archive: " << m_xpsArchive->fileName();
qCWarning(OkularXpsDebug) << "Could not open XPS archive: " << m_xpsArchive->fileName();
delete m_xpsArchive;
return false;
}
@ -1942,17 +1942,17 @@ bool XpsFile::loadDocument(const QString &filename)
} else if ("http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/origin" == type) {
m_signatureOrigin = target;
} else {
kDebug(XpsDebug) << "Unknown relationships element: " << type << " : " << target;
qCWarning(OkularXpsDebug) << "Unknown relationships element: " << type << " : " << target;
}
} else if ( relXml.name() == "Relationships" ) {
// nothing to do here - this is just the container level
} else {
kDebug(XpsDebug) << "unexpected element in _rels/.rels: " << relXml.name().toString();
qCWarning(OkularXpsDebug) << "unexpected element in _rels/.rels: " << relXml.name().toString();
}
}
}
if ( relXml.error() ) {
kDebug(XpsDebug) << "Could not parse _rels/.rels: " << relXml.errorString();
qCWarning(OkularXpsDebug) << "Could not parse _rels/.rels: " << relXml.errorString();
return false;
}
@ -1982,12 +1982,12 @@ bool XpsFile::loadDocument(const QString &filename)
} else if ( fixedRepXml.name() == "FixedDocumentSequence") {
// we don't do anything here - this is just a container for one or more DocumentReference elements
} else {
kDebug(XpsDebug) << "Unhandled entry in FixedDocumentSequence: " << fixedRepXml.name().toString();
qCWarning(OkularXpsDebug) << "Unhandled entry in FixedDocumentSequence: " << fixedRepXml.name().toString();
}
}
}
if ( fixedRepXml.error() ) {
kDebug(XpsDebug) << "Could not parse FixedRepresentation file:" << fixedRepXml.errorString();
qCWarning(OkularXpsDebug) << "Could not parse FixedRepresentation file:" << fixedRepXml.errorString();
return false;
}
@ -2037,10 +2037,10 @@ Okular::DocumentInfo XpsFile::generateDocumentInfo() const
}
if ( xml.error() )
{
kDebug(XpsDebug) << "Could not parse XPS core properties:" << xml.errorString();
qCWarning(OkularXpsDebug) << "Could not parse XPS core properties:" << xml.errorString();
}
} else {
kDebug(XpsDebug) << "No core properties filename";
qCWarning(OkularXpsDebug) << "No core properties filename";
}
docInfo.set( Okular::DocumentInfo::Pages, QString::number(numPages()) );
@ -2150,14 +2150,14 @@ Okular::TextPage* XpsGenerator::textPage( Okular::Page * page )
Okular::DocumentInfo XpsGenerator::generateDocumentInfo( const QSet<Okular::DocumentInfo::Key> &keys ) const
{
kDebug(XpsDebug) << "generating document metadata";
qCWarning(OkularXpsDebug) << "generating document metadata";
return m_xpsFile->generateDocumentInfo();
}
const Okular::DocumentSynopsis * XpsGenerator::generateDocumentSynopsis()
{
kDebug(XpsDebug) << "generating document synopsis";
qCWarning(OkularXpsDebug) << "generating document synopsis";
// we only generate the synopsis for the first file.
if ( !m_xpsFile || !m_xpsFile->document( 0 ) )
@ -2239,7 +2239,7 @@ QVariant XpsRenderNode::getRequiredChildData( const QString &name )
{
XpsRenderNode * child = findChild( name );
if (child == NULL) {
kDebug(XpsDebug) << "Required element " << name << " is missing in " << this->name;
qCWarning(OkularXpsDebug) << "Required element " << name << " is missing in " << this->name;
return QVariant();
}
@ -2256,5 +2256,7 @@ QVariant XpsRenderNode::getChildData( const QString &name )
}
}
Q_LOGGING_CATEGORY(OkularXpsDebug, "org.kde.okular.generators.xps")
#include "generator_xps.moc"

View file

@ -31,6 +31,7 @@
#include <QXmlDefaultHandler>
#include <QStack>
#include <QVariant>
#include <QtCore/qloggingcategory.h>
#include <kzip.h>
@ -323,4 +324,6 @@ class XpsGenerator : public Okular::Generator
XpsFile *m_xpsFile;
};
Q_DECLARE_LOGGING_CATEGORY(OkularXpsDebug)
#endif

View file

@ -72,6 +72,7 @@
// local includes
#include "aboutdata.h"
#include "extensions.h"
#include "ui/debug_ui.h"
#include "ui/pageview.h"
#include "ui/toc.h"
#include "ui/searchwidget.h"
@ -96,7 +97,6 @@
#include "core/generator.h"
#include "core/page.h"
#include "core/fileprinter.h"
#include <cstdio>
#include <memory>
@ -2152,7 +2152,7 @@ void Part::slotFindPrev()
bool Part::saveFile()
{
kDebug() << "Okular part doesn't support saving the file in the location from which it was opened";
qCDebug(OkularUiDebug) << "Okular part doesn't support saving the file in the location from which it was opened";
return false;
}

View file

@ -23,7 +23,7 @@
#include <kiconloader.h>
#include <klocale.h>
#include <knuminput.h>
#include <kdebug.h>
#include <QtCore/QDebug>
#include "core/document.h"
#include "guiutils.h"

View file

@ -27,7 +27,7 @@
#include <kglobal.h>
#include <klocale.h>
#include <ktextedit.h>
#include <kdebug.h>
#include <QtCore/QDebug>
#include <kaction.h>
#include <kstandardaction.h>
#include <qmenu.h>

View file

@ -17,7 +17,7 @@
#include <qtoolbar.h>
#include <qtreewidget.h>
#include <kdebug.h>
#include <QtCore/QDebug>
#include <kicon.h>
#include <klocale.h>
#include <kmenu.h>

View file

@ -26,7 +26,9 @@
#include <kpushbutton.h>
#include <kservice.h>
#include <ksharedconfig.h>
#include <kdebug.h>
#include <QtCore/qloggingcategory.h>
#include "debug_ui.h"
using namespace Okular;
@ -65,10 +67,10 @@ public:
void FilePrinterPreviewPrivate::getPart()
{
if (previewPart) {
kDebug(500) << "already got a part";
qCDebug(OkularUiDebug) << "already got a part";
return;
}
kDebug(500) << "querying trader for application/ps service";
qCDebug(OkularUiDebug) << "querying trader for application/ps service";
KPluginFactory *factory(0);
/* Explicitly look for the Okular/Ghostview part: no other PostScript
@ -83,15 +85,15 @@ void FilePrinterPreviewPrivate::getPart()
KPluginLoader loader(**it);
factory = loader.factory();
if (!factory) {
kDebug(500) << "Loading failed:" << loader.errorString();
qCDebug(OkularUiDebug) << "Loading failed:" << loader.errorString();
}
++it;
}
if (factory) {
kDebug(500) << "Trying to create a part";
qCDebug(OkularUiDebug) << "Trying to create a part";
previewPart = factory->create<KParts::ReadOnlyPart>(q, (QVariantList() << "Print/Preview"));
if (!previewPart) {
kDebug(500) << "Part creation failed";
qCDebug(OkularUiDebug) << "Part creation failed";
}
}
}
@ -99,14 +101,14 @@ void FilePrinterPreviewPrivate::getPart()
bool FilePrinterPreviewPrivate::doPreview()
{
if (!QFile::exists(filename)) {
kWarning() << "Nothing was produced to be previewed";
qCWarning(OkularUiDebug) << "Nothing was produced to be previewed";
return false;
}
getPart();
if (!previewPart) {
//TODO: error dialog
kWarning() << "Could not find a PS viewer for the preview dialog";
qCWarning(OkularUiDebug) << "Could not find a PS viewer for the preview dialog";
fail();
return false;
} else {
@ -130,7 +132,7 @@ FilePrinterPreview::FilePrinterPreview( const QString &filename, QWidget *parent
: KDialog( parent )
, d( new FilePrinterPreviewPrivate( this, filename ) )
{
kDebug(500) << "kdeprint: creating preview dialog";
qCDebug(OkularUiDebug) << "kdeprint: creating preview dialog";
// Set up the dialog
setCaption(i18n("Print Preview"));

View file

@ -33,7 +33,7 @@
#include <QtWidgets/QToolButton>
#include <QtWidgets/QTreeView>
#include <kdebug.h>
#include <QtCore/QDebug>
#include <kiconloader.h>
#include <klocale.h>
#include <ktoolbar.h>

View file

@ -12,7 +12,7 @@
#include "latexrenderer.h"
#include <kdebug.h>
#include <QtCore/QDebug>
#include <kstandarddirs.h>
#include <kprocess.h>
#include <ktemporaryfile.h>
@ -24,6 +24,8 @@
#include <QTextDocument>
#include <QTextStream>
#include "debug_ui.h"
namespace GuiUtils
{

View file

@ -16,7 +16,7 @@
#include <qpixmap.h>
#include <qvarlengtharray.h>
#include <kiconloader.h>
#include <kdebug.h>
#include <QtCore/QDebug>
#include <QApplication>
// TODO KF5 #include <qimageblitz.h>

View file

@ -20,6 +20,7 @@
#include "pageview.h"
// qt/kde includes
#include <QtCore/qloggingcategory.h>
#include <qcursor.h>
#include <qevent.h>
#include <qimage.h>
@ -43,7 +44,7 @@
#include <kinputdialog.h>
#include <kselectaction.h>
#include <ktoggleaction.h>
#include <kdebug.h>
#include <QtCore/QDebug>
#include <kdeversion.h>
#include <kmessagebox.h>
#include <kicon.h>
@ -57,6 +58,7 @@
#include <stdlib.h>
// local includes
#include "debug_ui.h"
#include "formwidgets.h"
#include "pageviewutils.h"
#include "pagepainter.h"
@ -1143,7 +1145,7 @@ void PageView::slotRealNotifyViewportChanged( bool smoothMove )
}
if ( !item )
{
kWarning() << "viewport for page" << vp.pageNumber << "has no matching item!";
qWarning() << "viewport for page" << vp.pageNumber << "has no matching item!";
d->blockViewport = false;
return;
}
@ -2560,7 +2562,7 @@ void PageView::mouseReleaseEvent( QMouseEvent * e )
{
// request the textpage if there isn't one
okularPage= item->page();
kWarning() << "checking if page" << item->pageNumber() << "has text:" << okularPage->hasTextPage();
qWarning() << "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
@ -2707,7 +2709,7 @@ void PageView::mouseReleaseEvent( QMouseEvent * e )
{
// request the textpage if there isn't one
okularPage= item->page();
kWarning() << "checking if page" << item->pageNumber() << "has text:" << okularPage->hasTextPage();
qWarning() << "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

View file

@ -10,6 +10,7 @@
#include "pageviewannotator.h"
// qt / kde includes
#include <QtCore/qloggingcategory.h>
#include <qapplication.h>
#include <qfile.h>
#include <qcolor.h>
@ -23,7 +24,7 @@
#include <kstandarddirs.h>
#include <kinputdialog.h>
#include <kuser.h>
#include <kdebug.h>
#include <QtCore/QDebug>
#include <kmenu.h>
// system includes
@ -38,6 +39,7 @@
#include "annotationtools.h"
#include "guiutils.h"
#include "pageview.h"
#include "debug_ui.h"
/** @short PickPointEngine */
class PickPointEngine : public AnnotatorEngine
@ -671,7 +673,7 @@ void PageViewAnnotator::reparseConfig()
if ( entryParser.setContent( toolXml ) )
m_toolsDefinition.appendChild( doc.importNode( entryParser.documentElement(), true ) );
else
kWarning() << "Skipping malformed tool XML in AnnotationTools setting";
qCWarning(OkularUiDebug) << "Skipping malformed tool XML in AnnotationTools setting";
}
// Create the AnnotationToolItems from the XML dom tree
@ -1008,7 +1010,7 @@ void PageViewAnnotator::slotToolSelected( int toolID )
else if ( type == "TextSelector" )
m_engine = new TextSelectorEngine( toolSubElement, m_pageView );
else
kWarning().nospace() << "tools.xml: engine type:'" << type << "' is not defined!";
qCWarning(OkularUiDebug).nospace() << "tools.xml: engine type:'" << type << "' is not defined!";
}
// display the tooltip
@ -1047,7 +1049,7 @@ void PageViewAnnotator::slotToolSelected( int toolID )
// consistancy warning
if ( !m_engine )
{
kWarning() << "tools.xml: couldn't find good engine description. check xml.";
qCWarning(OkularUiDebug) << "tools.xml: couldn't find good engine description. check xml.";
}
m_pageView->updateCursor();

View file

@ -10,6 +10,7 @@
#include "presentationwidget.h"
// qt/kde includes
#include <QtCore/qloggingcategory.h>
#include <QtDBus/QDBusConnection>
#include <QtDBus/QDBusMessage>
#include <QtDBus/QDBusReply>
@ -50,6 +51,7 @@
// local includes
#include "annotationtools.h"
#include "debug_ui.h"
#include "guiutils.h"
#include "pagepainter.h"
#include "presentationsearchbar.h"
@ -313,7 +315,7 @@ void PresentationWidget::notifySetup( const QVector< Okular::Page * > & pageSet,
for ( ; fIt != fEnd; ++fIt )
delete *fIt;
if ( !m_frames.isEmpty() )
kWarning() << "Frames setup changed while a Presentation is in progress.";
qCWarning(OkularUiDebug) << "Frames setup changed while a Presentation is in progress.";
m_frames.clear();
// create the new frames