[EPubGenerator] Fetch the application palette just once

Summary:
There is no reason to fetch the palette once per loop,
just do it once

Reviewers: #okular, ngraham

Reviewed By: ngraham

Subscribers: okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D20947
remotes/origin/gsoc2019_animatedpdf
Stefan Brüns 7 years ago
parent f7fbbf769b
commit 43cf8c8aef
  1. 14
      generators/epub/converter.cpp

@ -201,6 +201,14 @@ QTextDocument* Converter::convert( const QString &fileName )
bool firstPage = true;
QVector<Okular::MovieAnnotation *> movieAnnots;
QVector<Okular::SoundAction *> soundActions;
// HACK BEGIN Get the links without CSS to be blue
// Remove if Qt ever gets fixed and the code in textdocumentgenerator.cpp works
const QPalette orig = qApp->palette();
QPalette p = orig;
p.setColor(QPalette::Link, Qt::blue);
// HACK END
const QSize videoSize(320, 240);
do{
if(!epub_it_get_curr(it)) {
@ -289,11 +297,7 @@ QTextDocument* Converter::convert( const QString &fileName )
htmlContent = dom.toString();
}
// HACK BEGIN Get the links without CSS to be blue
// Remove if Qt ever gets fixed and the code in textdocumentgenerator.cpp works
const QPalette orig = qApp->palette();
QPalette p = orig;
p.setColor(QPalette::Link, Qt::blue);
// HACK BEGIN
qApp->setPalette(p);
// HACK END

Loading…
Cancel
Save