Commit f4678075 authored by Albert Astals Cid's avatar Albert Astals Cid

Remove #ifdefs for Qt we require in cmake anyway

parent b13fc1d3
......@@ -19,9 +19,7 @@
#include <QtGui/QImage>
#include <QtGui/QPainter>
#include <QtPrintSupport/QPrinter>
#if QT_VERSION >= 0x040500
#include <QtGui/QTextDocumentWriter>
#endif
#include "action.h"
#include "annotations.h"
......@@ -476,14 +474,12 @@ Okular::ExportFormat::List TextDocumentGenerator::exportFormats( ) const
if ( formats.isEmpty() ) {
formats.append( Okular::ExportFormat::standardFormat( Okular::ExportFormat::PlainText ) );
formats.append( Okular::ExportFormat::standardFormat( Okular::ExportFormat::PDF ) );
#if QT_VERSION >= 0x040500
if ( QTextDocumentWriter::supportedDocumentFormats().contains( "ODF" ) ) {
formats.append( Okular::ExportFormat::standardFormat( Okular::ExportFormat::OpenDocumentText ) );
}
if ( QTextDocumentWriter::supportedDocumentFormats().contains( "HTML" ) ) {
formats.append( Okular::ExportFormat::standardFormat( Okular::ExportFormat::HTML ) );
}
#endif
}
return formats;
......@@ -515,7 +511,6 @@ bool TextDocumentGenerator::exportTo( const QString &fileName, const Okular::Exp
out << d->mDocument->toPlainText();
return true;
#if QT_VERSION >= 0x040500
} else if ( format.mimeType().name() == QLatin1String( "application/vnd.oasis.opendocument.text" ) ) {
QTextDocumentWriter odfWriter( fileName, "odf" );
......@@ -524,7 +519,6 @@ bool TextDocumentGenerator::exportTo( const QString &fileName, const Okular::Exp
QTextDocumentWriter odfWriter( fileName, "html" );
return odfWriter.write( d->mDocument );
#endif
}
return false;
}
......
......@@ -79,17 +79,7 @@ bool KIMGIOGenerator::loadDocumentInternal(const QByteArray & fileData, const QS
// Apply transformations dictated by Exif metadata
KExiv2Iface::KExiv2 exifMetadata;
if ( exifMetadata.loadFromData( fileData ) ) {
#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) && QT_VERSION < QT_VERSION_CHECK(5, 4, 2)
// Qt 5.4 (up to 5.4.1) rotates jpeg images automatically with no way of disabling it
// See https://bugreports.qt.io/browse/QTBUG-37946
// and https://codereview.qt-project.org/#/c/98013/
// and https://codereview.qt-project.org/#/c/110668/
if (reader.format() != QByteArrayLiteral("jpeg")) {
exifMetadata.rotateExifQImage( m_img, exifMetadata.getImageOrientation() );
}
#else
exifMetadata.rotateExifQImage(m_img, exifMetadata.getImageOrientation());
#endif
}
pagesVector.resize( 1 );
......
......@@ -2066,10 +2066,8 @@ XpsGenerator::XpsGenerator( QObject *parent, const QVariantList &args )
// 1) QFontDatabase says so
// 2) Qt >= 4.4.0 (see Trolltech task ID: 169502)
// 3) Qt >= 4.4.2 (see Trolltech task ID: 215090)
#if QT_VERSION >= 0x040402
if ( QFontDatabase::supportsThreadedFontRendering() )
setFeature( Threaded );
#endif
userMutex();
}
......
......@@ -37,18 +37,7 @@ FileExistFunc qfileExistFunc()
QUrl urlFromArg( const QString& _arg, FileExistFunc exist_func, const QString& pageArg )
{
#if QT_VERSION >= 0x050400
QUrl url = QUrl::fromUserInput(_arg, QDir::currentPath(), QUrl::AssumeLocalFile);
#else
// Code from QUrl::fromUserInput(QString, QString)
QUrl url = QUrl::fromUserInput(_arg);
QUrl testUrl = QUrl(_arg, QUrl::TolerantMode);
if (testUrl.isRelative() && !QDir::isAbsolutePath(_arg)) {
QFileInfo fileInfo(QDir::current(), _arg);
if (fileInfo.exists())
url = QUrl::fromLocalFile(fileInfo.absoluteFilePath());
}
#endif
if ( url.isLocalFile() ) {
// make sure something like /tmp/foo#bar.pdf is treated as a path name (default)
// but something like /tmp/foo.pdf#bar is foo.pdf plus an anchor "bar"
......
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