mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-27 03:30:20 +00:00
Port the EPubGenerator
This commit is contained in:
parent
eee26dd72f
commit
fb330dd45c
|
@ -273,7 +273,7 @@ void TextDocumentGeneratorPrivate::initializeGenerator()
|
||||||
}
|
}
|
||||||
|
|
||||||
TextDocumentGenerator::TextDocumentGenerator( TextDocumentConverter *converter, const QString& configName )
|
TextDocumentGenerator::TextDocumentGenerator( TextDocumentConverter *converter, const QString& configName )
|
||||||
: Okular::Generator( *new TextDocumentGeneratorPrivate( converter ) )
|
: Okular::Generator( *new TextDocumentGeneratorPrivate( converter ) )
|
||||||
{
|
{
|
||||||
Q_D( TextDocumentGenerator );
|
Q_D( TextDocumentGenerator );
|
||||||
d->mGeneralSettings = new TextDocumentSettings( configName, this );
|
d->mGeneralSettings = new TextDocumentSettings( configName, this );
|
||||||
|
|
|
@ -120,9 +120,9 @@ add_subdirectory(comicbook)
|
||||||
# add_subdirectory(plucker)
|
# add_subdirectory(plucker)
|
||||||
#endif(JPEG_FOUND AND ZLIB_FOUND)
|
#endif(JPEG_FOUND AND ZLIB_FOUND)
|
||||||
|
|
||||||
#if(EPUB_FOUND)
|
if(EPUB_FOUND)
|
||||||
# add_subdirectory(epub)
|
add_subdirectory(epub)
|
||||||
#endif(EPUB_FOUND)
|
endif(EPUB_FOUND)
|
||||||
|
|
||||||
#add_subdirectory(txt)
|
#add_subdirectory(txt)
|
||||||
|
|
||||||
|
|
|
@ -14,9 +14,9 @@ set(okularGenerator_epub_PART_SRCS
|
||||||
generator_epub.cpp
|
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})
|
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));
|
frag.position()+fragLen));
|
||||||
} else { // Outside document link
|
} else { // Outside document link
|
||||||
Okular::BrowseAction *action =
|
Okular::BrowseAction *action =
|
||||||
new Okular::BrowseAction(href.toString());
|
new Okular::BrowseAction(QUrl(href.toString()));
|
||||||
|
|
||||||
emit addAction(action, frag.position(),
|
emit addAction(action, frag.position(),
|
||||||
frag.position() + frag.length());
|
frag.position() + frag.length());
|
||||||
|
|
|
@ -82,7 +82,7 @@ QVariant EpubDocument::loadResource(int type, const QUrl &name)
|
||||||
char *data;
|
char *data;
|
||||||
|
|
||||||
// Get the data from the epub file
|
// 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;
|
QVariant resource;
|
||||||
|
|
||||||
|
|
|
@ -11,18 +11,18 @@
|
||||||
|
|
||||||
#include "converter.h"
|
#include "converter.h"
|
||||||
|
|
||||||
#include <kaboutdata.h>
|
#include <k4aboutdata.h>
|
||||||
#include <kconfigdialog.h>
|
#include <kconfigdialog.h>
|
||||||
|
|
||||||
static KAboutData createAboutData()
|
static K4AboutData createAboutData()
|
||||||
{
|
{
|
||||||
KAboutData aboutData(
|
K4AboutData aboutData(
|
||||||
"okular_epub",
|
"okular_epub",
|
||||||
"okular_epub",
|
"okular_epub",
|
||||||
ki18n("EPub Backend"),
|
ki18n("EPub Backend"),
|
||||||
"0.2.3",
|
"0.2.3",
|
||||||
ki18n("An EPub backend"),
|
ki18n("An EPub backend"),
|
||||||
KAboutData::License_GPL,
|
K4AboutData::License_GPL,
|
||||||
ki18n("© 2008 Ely Levy")
|
ki18n("© 2008 Ely Levy")
|
||||||
);
|
);
|
||||||
aboutData.addAuthor(ki18n("Ely Levy"), KLocalizedString(),
|
aboutData.addAuthor(ki18n("Ely Levy"), KLocalizedString(),
|
||||||
|
@ -34,7 +34,11 @@ static KAboutData createAboutData()
|
||||||
OKULAR_EXPORT_PLUGIN( EPubGenerator, createAboutData() )
|
OKULAR_EXPORT_PLUGIN( EPubGenerator, createAboutData() )
|
||||||
|
|
||||||
EPubGenerator::EPubGenerator( QObject *parent, const QVariantList &args )
|
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") );
|
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
|
class EPubGenerator : public Okular::TextDocumentGenerator
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
EPubGenerator( QObject *parent, const QVariantList &args );
|
EPubGenerator( QObject *parent, const QVariantList &args );
|
||||||
~EPubGenerator() {}
|
~EPubGenerator();
|
||||||
|
|
||||||
// [INHERITED] reparse configuration
|
// [INHERITED] reparse configuration
|
||||||
void addPages( KConfigDialog* dlg );
|
void addPages( KConfigDialog* dlg );
|
||||||
|
|
Loading…
Reference in a new issue