Commit fb330dd4 authored by Vishesh Handa's avatar Vishesh Handa
Browse files

Port the EPubGenerator

parent eee26dd7
......@@ -273,7 +273,7 @@ void TextDocumentGeneratorPrivate::initializeGenerator()
}
TextDocumentGenerator::TextDocumentGenerator( TextDocumentConverter *converter, const QString& configName )
: Okular::Generator( *new TextDocumentGeneratorPrivate( converter ) )
: Okular::Generator( *new TextDocumentGeneratorPrivate( converter ) )
{
Q_D( TextDocumentGenerator );
d->mGeneralSettings = new TextDocumentSettings( configName, this );
......
......@@ -120,9 +120,9 @@ add_subdirectory(comicbook)
# add_subdirectory(plucker)
#endif(JPEG_FOUND AND ZLIB_FOUND)
#if(EPUB_FOUND)
# add_subdirectory(epub)
#endif(EPUB_FOUND)
if(EPUB_FOUND)
add_subdirectory(epub)
endif(EPUB_FOUND)
#add_subdirectory(txt)
......
......@@ -14,9 +14,9 @@ set(okularGenerator_epub_PART_SRCS
generator_epub.cpp
)
kde4_add_plugin(okularGenerator_epub ${okularGenerator_epub_PART_SRCS})
add_library(okularGenerator_epub MODULE ${okularGenerator_epub_PART_SRCS})
target_link_libraries(okularGenerator_epub okularcore ${EPUB_LIBRARIES} ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBS} ${QT_QTGUI_LIBRARY} ${QT_QTXML_LIBRARY})
target_link_libraries(okularGenerator_epub okularcore ${EPUB_LIBRARIES} KF5::KDELibs4Support Qt5::Widgets Qt5::Xml)
install(TARGETS okularGenerator_epub DESTINATION ${PLUGIN_INSTALL_DIR})
......
......@@ -110,7 +110,7 @@ void Converter::_handle_anchors(const QTextBlock &start, const QString &name) {
frag.position()+fragLen));
} else { // Outside document link
Okular::BrowseAction *action =
new Okular::BrowseAction(href.toString());
new Okular::BrowseAction(QUrl(href.toString()));
emit addAction(action, frag.position(),
frag.position() + frag.length());
......
......@@ -82,7 +82,7 @@ QVariant EpubDocument::loadResource(int type, const QUrl &name)
char *data;
// Get the data from the epub file
size = epub_get_data(mEpub, resourceUrl(mCurrentSubDocument, name.toString()).toUtf8(), &data);
size = epub_get_data(mEpub, resourceUrl(mCurrentSubDocument, name.toString()).toUtf8().constData(), &data);
QVariant resource;
......
......@@ -11,18 +11,18 @@
#include "converter.h"
#include <kaboutdata.h>
#include <k4aboutdata.h>
#include <kconfigdialog.h>
static KAboutData createAboutData()
static K4AboutData createAboutData()
{
KAboutData aboutData(
K4AboutData aboutData(
"okular_epub",
"okular_epub",
ki18n("EPub Backend"),
"0.2.3",
ki18n("An EPub backend"),
KAboutData::License_GPL,
K4AboutData::License_GPL,
ki18n("© 2008 Ely Levy")
);
aboutData.addAuthor(ki18n("Ely Levy"), KLocalizedString(),
......@@ -34,7 +34,11 @@ static KAboutData createAboutData()
OKULAR_EXPORT_PLUGIN( EPubGenerator, createAboutData() )
EPubGenerator::EPubGenerator( QObject *parent, const QVariantList &args )
: Okular::TextDocumentGenerator( new Epub::Converter, "okular_epub_generator_settings", parent, args )
: Okular::TextDocumentGenerator( new Epub::Converter, "okular_epub_generator_settings" )
{
}
EPubGenerator::~EPubGenerator()
{
}
......@@ -44,3 +48,5 @@ void EPubGenerator::addPages( KConfigDialog* dlg )
dlg->addPage( widget, generalSettings(), i18n("EPub"), "application-epub+zip", i18n("EPub Backend Configuration") );
}
#include "generator_epub.moc"
......@@ -13,9 +13,10 @@
class EPubGenerator : public Okular::TextDocumentGenerator
{
Q_OBJECT
public:
EPubGenerator( QObject *parent, const QVariantList &args );
~EPubGenerator() {}
~EPubGenerator();
// [INHERITED] reparse configuration
void addPages( KConfigDialog* dlg );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment