Commit 2d8df458 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

kdelibs4support--

parent b98cea80
......@@ -328,15 +328,17 @@ void dviRenderer::embedPostScript()
if (!dviFile)
return;
/* embedPS_progress = new KProgressDialog(parentWidget,
i18n("Embedding PostScript Files"), QString(), true); */
/* embedPS_progress = new QProgressDialog(parentWidget);
embedPS_progress->setWindowTitle(i18n("Embedding PostScript Files"));
embedPS_progress->setLabelText(QString());
*/
if (!embedPS_progress)
return;
embedPS_progress->setAllowCancel(false);
embedPS_progress->showCancelButton(false);
embedPS_progress->setCancelButton(0);
embedPS_progress->setCancelButton(0);
embedPS_progress->setMinimumDuration(400);
embedPS_progress->progressBar()->setMaximum(dviFile->numberOfExternalPSFiles);
embedPS_progress->progressBar()->setValue(0);
embedPS_progress->setMaximum(dviFile->numberOfExternalPSFiles);
embedPS_progress->setValue(0);
embedPS_numOfProgressedFiles = 0;
quint16 currPageSav = current_page;
......
......@@ -22,7 +22,7 @@
#include <QExplicitlySharedDataPointer>
#include <kurl.h>
#include <kprogressdialog.h>
#include <QProgressDialog>
#include <QHash>
#include <QPolygon>
#include <QStack>
......@@ -37,7 +37,7 @@ class dvifile;
class dviRenderer;
class ghostscript_interface;
class QEventLoop;
class KProgressDialog;
class QProgressDialog;
class PreBookmark;
class TeXFontDefinition;
......@@ -230,7 +230,7 @@ private:
/** Utility fields used by the embedPostScript method*/
KProgressDialog *embedPS_progress;
QProgressDialog *embedPS_progress;
quint16 embedPS_numOfProgressedFiles;
/** Shrink factor. Units are not quite clear */
......
......@@ -103,7 +103,7 @@ void dviRenderer::prescan_embedPS(char *cp, quint8 *beginningOfSpecialCommand)
errorMsg += i18n("Page %1: The PDF file <strong>%2</strong> could not be converted to PostScript.<br>", page+1, originalFName);
else
errorMsg += i18n("Page %1: The PostScript file <strong>%2</strong> could not be found.<br>", page+1, originalFName);
embedPS_progress->progressBar()->setValue(embedPS_progress->progressBar()->value()+1);
embedPS_progress->setValue(embedPS_progress->value()+1);
qApp->processEvents();
return;
}
......@@ -217,7 +217,7 @@ void dviRenderer::prescan_embedPS(char *cp, quint8 *beginningOfSpecialCommand)
dviFile->setNewData(newDVI);
embedPS_progress->progressBar()->setValue(embedPS_progress->progressBar()->value()+1);
embedPS_progress->setValue(embedPS_progress->value()+1);
qApp->processEvents();
return;
}
......
......@@ -18,12 +18,13 @@
#include <QtCore/QDebug>
#include <KLocalizedString>
#include <KStandardDirs>
#include <core/action.h>
#include <core/movie.h>
#include <core/sound.h>
#include <core/annotations.h>
#include <QStandardPaths>
using namespace Epub;
......@@ -222,9 +223,9 @@ QTextDocument* Converter::convert( const QString &fileName )
QDomNodeList svgs = dom.elementsByTagName("svg");
if(!svgs.isEmpty()) {
QList< QDomNode > imgNodes;
for (uint i = 0; i < svgs.length(); ++i) {
for (int i = 0; i < svgs.length(); ++i) {
QDomNodeList images = svgs.at(i).toElement().elementsByTagName("image");
for (uint j = 0; j < images.length(); ++j) {
for (int j = 0; j < images.length(); ++j) {
QString lnk = images.at(i).toElement().attribute("xlink:href");
int ht = images.at(i).toElement().attribute("height").toInt();
int wd = images.at(i).toElement().attribute("width").toInt();
......@@ -320,7 +321,7 @@ QTextDocument* Converter::convert( const QString &fileName )
while( !(csr = mTextDocument->find("<video></video>",csr)).isNull() ) {
const int posStart = csr.position();
const QPoint startPoint = calculateXYPosition(mTextDocument, posStart);
QImage img(KStandardDirs::locate("data", "okular/pics/okular-epub-movie.png"));
QImage img(QStandardPaths::locate(QStandardPaths::GenericDataLocation, "okular/pics/okular-epub-movie.png"));
img = img.scaled(videoSize);
csr.insertImage(img);
const int posEnd = csr.position();
......@@ -335,7 +336,7 @@ QTextDocument* Converter::convert( const QString &fileName )
const QString keyToSearch("<audio></audio>");
while( !(csr = mTextDocument->find(keyToSearch, csr)).isNull() ) {
const int posStart = csr.position() - keyToSearch.size();
const QImage img(KStandardDirs::locate("data", "okular/pics/okular-epub-sound-icon.png"));
const QImage img(QStandardPaths::locate(QStandardPaths::GenericDataLocation, "okular/pics/okular-epub-sound-icon.png"));
csr.insertImage(img);
const int posEnd = csr.position();
qDebug() << posStart << posEnd;;
......
Markdown is supported
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