From f46780750638d3743deb090409b0298898e194c1 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 16 Jan 2017 00:36:08 +0100 Subject: [PATCH] Remove #ifdefs for Qt we require in cmake anyway --- core/textdocumentgenerator.cpp | 6 ------ generators/kimgio/generator_kimgio.cpp | 10 ---------- generators/xps/generator_xps.cpp | 2 -- shell/shellutils.cpp | 11 ----------- 4 files changed, 29 deletions(-) diff --git a/core/textdocumentgenerator.cpp b/core/textdocumentgenerator.cpp index 88facc0f3..e7c3558de 100644 --- a/core/textdocumentgenerator.cpp +++ b/core/textdocumentgenerator.cpp @@ -19,9 +19,7 @@ #include #include #include -#if QT_VERSION >= 0x040500 #include -#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; } diff --git a/generators/kimgio/generator_kimgio.cpp b/generators/kimgio/generator_kimgio.cpp index fd0764173..2247a2cb7 100644 --- a/generators/kimgio/generator_kimgio.cpp +++ b/generators/kimgio/generator_kimgio.cpp @@ -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 ); diff --git a/generators/xps/generator_xps.cpp b/generators/xps/generator_xps.cpp index c15da1736..6df65f696 100644 --- a/generators/xps/generator_xps.cpp +++ b/generators/xps/generator_xps.cpp @@ -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(); } diff --git a/shell/shellutils.cpp b/shell/shellutils.cpp index 1b280199f..17ceb8b6a 100644 --- a/shell/shellutils.cpp +++ b/shell/shellutils.cpp @@ -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"