From 7b9f83cfd9cebba1d4fa7fe397691117be91bf1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Pereira?= Date: Thu, 22 Aug 2013 07:02:43 -0700 Subject: Reworks the detect Qt5 then abort MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit One check at the source code level is enough. Added a check in the project file so we can abort earlier. Change-Id: I37f2562d583c5fb54005e22a2a6894dc9054c8f3 Signed-off-by: Luís Pereira Reviewed-by: David Faure (KDE) --- qtmimetypes.pro | 7 +++++++ src/mimetypes/qmimedatabase.h | 2 -- src/mimetypes/qmimetype.h | 6 ------ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/qtmimetypes.pro b/qtmimetypes.pro index db7fc14..007371a 100644 --- a/qtmimetypes.pro +++ b/qtmimetypes.pro @@ -1,5 +1,12 @@ include(doc/doc.pri) +# check qt version +greaterThan(QT_MAJOR_VERSION, 4) { + message("Cannot build with Qt version $${QT_VERSION}.") + message("With Qt5 use QtCore/QMimeType instead") + error("Qt $${QT_VERSION} not supported") +} + TEMPLATE = subdirs module_include.subdir = include diff --git a/src/mimetypes/qmimedatabase.h b/src/mimetypes/qmimedatabase.h index f573ee8..bca0b50 100644 --- a/src/mimetypes/qmimedatabase.h +++ b/src/mimetypes/qmimedatabase.h @@ -49,10 +49,8 @@ #include #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) -#ifndef Q_CC_MSVC #error "Do not try to use this library with Qt5, use QtCore/QMimeType instead" #endif -#endif QT_BEGIN_NAMESPACE diff --git a/src/mimetypes/qmimetype.h b/src/mimetypes/qmimetype.h index 78bf9f7..3d281ae 100644 --- a/src/mimetypes/qmimetype.h +++ b/src/mimetypes/qmimetype.h @@ -47,12 +47,6 @@ #include #include -#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) -#ifndef Q_CC_MSVC -// TODO #error "Do not try to use this library with Qt5, use QtCore/QMimeType instead" -#endif -#endif - QT_BEGIN_NAMESPACE class QMimeTypePrivate; -- cgit v1.2.3