summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2014-10-04 12:22:14 (GMT)
committerMontel Laurent <montel@kde.org>2014-10-04 12:22:14 (GMT)
commitfc13e5c14817093b26e00d7e822c39837142cb4e (patch)
tree46bad270ce69bb007ff5df97974217be29469466
parent47a278b5fd3fd4f36ae152485dc06629f6c7a603 (diff)
Reactivate djvu generator
-rw-r--r--generators/CMakeLists.txt6
-rw-r--r--generators/djvu/generator_djvu.cpp10
-rw-r--r--generators/djvu/kdjvu.cpp9
3 files changed, 13 insertions, 12 deletions
diff --git a/generators/CMakeLists.txt b/generators/CMakeLists.txt
index 93c3219..ca5f3a9 100644
--- a/generators/CMakeLists.txt
+++ b/generators/CMakeLists.txt
@@ -96,9 +96,9 @@ if(CHM_FOUND)
add_subdirectory( chm )
endif(CHM_FOUND)
-#if(DJVULIBRE_FOUND)
-# add_subdirectory(djvu)
-#endif(DJVULIBRE_FOUND)
+if(DJVULIBRE_FOUND)
+ add_subdirectory(djvu)
+endif(DJVULIBRE_FOUND)
add_subdirectory(dvi)
diff --git a/generators/djvu/generator_djvu.cpp b/generators/djvu/generator_djvu.cpp
index f5b1c13..1254685 100644
--- a/generators/djvu/generator_djvu.cpp
+++ b/generators/djvu/generator_djvu.cpp
@@ -29,6 +29,7 @@
#include <QtCore/QDebug>
#include <klocale.h>
#include <qtemporaryfile.h>
+#include <QDir>
static void recurseCreateTOC( QDomDocument &maindoc, const QDomNode &parent, QDomNode &parentDestination, KDjVu *djvu )
{
@@ -73,10 +74,9 @@ static KAboutData createAboutData()
i18n( "DjVu Backend" ),
"0.2.3",
i18n( "DjVu backend based on DjVuLibre." ),
- KAboutLicense::GPL
- i18n( "© 2006-2008 Pino Toscano" )
- );
- aboutData.addAuthor( ki18n( "Pino Toscano" ), KLocalizedString(), "pino@kde.org" );
+ KAboutLicense::GPL,
+ i18n( "© 2006-2008 Pino Toscano" ));
+ aboutData.addAuthor( i18n( "Pino Toscano" ), QString(), QLatin1String("pino@kde.org") );
return aboutData;
}
@@ -333,7 +333,7 @@ Okular::ObjectRect* DjVuGenerator::convertKDjVuLink( int page, KDjVu::Link * lin
{
KDjVu::UrlLink* l = static_cast<KDjVu::UrlLink*>( link );
QString url = l->url();
- newlink = new Okular::BrowseAction( url );
+ newlink = new Okular::BrowseAction( QUrl(url) );
break;
}
}
diff --git a/generators/djvu/kdjvu.cpp b/generators/djvu/kdjvu.cpp
index 89aa685..3fdeac7 100644
--- a/generators/djvu/kdjvu.cpp
+++ b/generators/djvu/kdjvu.cpp
@@ -25,6 +25,7 @@
#include <libdjvu/miniexp.h>
#include <stdio.h>
+#include <KDebug>
QDebug &operator<<( QDebug & s, const ddjvu_rect_t &r )
{
@@ -275,7 +276,7 @@ void KDjVu::Annotation::setComment( const QString &comment )
miniexp_t exp = m_anno;
exp = miniexp_cdr( exp );
exp = miniexp_cdr( exp );
- miniexp_rplaca( exp, miniexp_string( comment.toUtf8() ) );
+ miniexp_rplaca( exp, miniexp_string( comment.toUtf8().constData() ) );
}
QColor KDjVu::Annotation::color() const
@@ -330,7 +331,7 @@ QColor KDjVu::TextAnnotation::color() const
void KDjVu::TextAnnotation::setColor( const QColor &color )
{
const QByteArray col = color.name().toLatin1();
- find_replace_or_add_second_in_pair( m_anno, "backclr", miniexp_symbol( col ) );
+ find_replace_or_add_second_in_pair( m_anno, "backclr", miniexp_symbol( col.constData() ) );
}
bool KDjVu::TextAnnotation::inlineText() const
@@ -375,7 +376,7 @@ QColor KDjVu::LineAnnotation::color() const
void KDjVu::LineAnnotation::setColor( const QColor &color )
{
const QByteArray col = color.name().toLatin1();
- find_replace_or_add_second_in_pair( m_anno, "lineclr", miniexp_symbol( col ) );
+ find_replace_or_add_second_in_pair( m_anno, "lineclr", miniexp_symbol( col.constData() ) );
}
QPoint KDjVu::LineAnnotation::point2() const
@@ -667,7 +668,7 @@ bool KDjVu::openFile( const QString & fileName )
closeFile();
// load the document...
- d->m_djvu_document = ddjvu_document_create_by_filename( d->m_djvu_cxt, QFile::encodeName( fileName ), true );
+ d->m_djvu_document = ddjvu_document_create_by_filename( d->m_djvu_cxt, QFile::encodeName( fileName ).constData(), true );
if ( !d->m_djvu_document ) return false;
// ...and wait for its loading
wait_for_ddjvu_message( d->m_djvu_cxt, DDJVU_DOCINFO );