summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2014-10-16 20:40:40 (GMT)
committerMontel Laurent <montel@kde.org>2014-10-16 20:40:40 (GMT)
commit2d8df4584513cba75d5be49748a5fbe59696bd4f (patch)
tree137f55dbfdc5250e2812dc786513bcca7e023f0c
parentb98cea80a97e48c1d13a3b96bb78f854d8090e29 (diff)
kdelibs4support--
-rw-r--r--generators/dvi/dviRenderer.cpp14
-rw-r--r--generators/dvi/dviRenderer.h6
-rw-r--r--generators/dvi/dviRenderer_prescan.cpp4
-rw-r--r--generators/epub/converter.cpp11
4 files changed, 19 insertions, 16 deletions
diff --git a/generators/dvi/dviRenderer.cpp b/generators/dvi/dviRenderer.cpp
index 0bff7c2..1475fb4 100644
--- a/generators/dvi/dviRenderer.cpp
+++ b/generators/dvi/dviRenderer.cpp
@@ -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;
diff --git a/generators/dvi/dviRenderer.h b/generators/dvi/dviRenderer.h
index 327b340..36623c2 100644
--- a/generators/dvi/dviRenderer.h
+++ b/generators/dvi/dviRenderer.h
@@ -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 */
diff --git a/generators/dvi/dviRenderer_prescan.cpp b/generators/dvi/dviRenderer_prescan.cpp
index ba0e41b..a9ddfe8 100644
--- a/generators/dvi/dviRenderer_prescan.cpp
+++ b/generators/dvi/dviRenderer_prescan.cpp
@@ -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;
}
diff --git a/generators/epub/converter.cpp b/generators/epub/converter.cpp
index ac0338c..92fb2bd 100644
--- a/generators/epub/converter.cpp
+++ b/generators/epub/converter.cpp
@@ -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;;