summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolf-Michael Bolle <wolf-michael.bolle@nokia.com>2011-12-18 12:48:00 +0100
committerWolf-Michael Bolle <wolf-michael.bolle@nokia.com>2011-12-18 12:48:00 +0100
commita8cf40aa15fb5524c798cc09f715adadeaed42c0 (patch)
tree1f80af1197e61caac9b33bb4ddb281e5d2a05933
parent3429f5cd4a001dd48cf322ab083cb2127f8aaef7 (diff)
Make code compile under Qt 4.x
-rw-r--r--include/QtMimeTypes/QtMimeTypes.pro7
-rw-r--r--src/mimetypes/qmimetype.cpp2
-rw-r--r--tests/auto/qdeclarativemimedatabase/tst_qdeclarativemimedatabase.cpp9
-rw-r--r--tests/auto/qdeclarativemimetype/tst_qdeclarativemimetype.cpp9
4 files changed, 26 insertions, 1 deletions
diff --git a/include/QtMimeTypes/QtMimeTypes.pro b/include/QtMimeTypes/QtMimeTypes.pro
index 76a80fc..8ff93a8 100644
--- a/include/QtMimeTypes/QtMimeTypes.pro
+++ b/include/QtMimeTypes/QtMimeTypes.pro
@@ -1,4 +1,9 @@
-TEMPLATE = aux
+equals(QT_VERSION, 4.7.4): {
+ TEMPLATE = subdirs
+}
+else {
+ TEMPLATE = aux
+}
the_includes.files += QMimeDatabase \
QMimeType \
diff --git a/src/mimetypes/qmimetype.cpp b/src/mimetypes/qmimetype.cpp
index 514a074..a8b53b2 100644
--- a/src/mimetypes/qmimetype.cpp
+++ b/src/mimetypes/qmimetype.cpp
@@ -302,7 +302,9 @@ QString QMimeType::comment(const QString& localeName) const
if (!localeName.isEmpty())
languageList << localeName;
languageList << QLocale::system().name();
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
languageList << QLocale::system().uiLanguages();
+#endif
Q_FOREACH(const QString& lang, languageList) {
const QString comm = d->localeComments.value(lang);
if (!comm.isEmpty())
diff --git a/tests/auto/qdeclarativemimedatabase/tst_qdeclarativemimedatabase.cpp b/tests/auto/qdeclarativemimedatabase/tst_qdeclarativemimedatabase.cpp
index 4479743..3aea081 100644
--- a/tests/auto/qdeclarativemimedatabase/tst_qdeclarativemimedatabase.cpp
+++ b/tests/auto/qdeclarativemimedatabase/tst_qdeclarativemimedatabase.cpp
@@ -39,6 +39,15 @@
**
****************************************************************************/
+#include <QtCore/qglobal.h>
+
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
#include <QtQuickTest/quicktest.h>
QUICK_TEST_MAIN(mytest)
+#else
+int main()
+{
+ return 1;
+}
+#endif
diff --git a/tests/auto/qdeclarativemimetype/tst_qdeclarativemimetype.cpp b/tests/auto/qdeclarativemimetype/tst_qdeclarativemimetype.cpp
index 4479743..3aea081 100644
--- a/tests/auto/qdeclarativemimetype/tst_qdeclarativemimetype.cpp
+++ b/tests/auto/qdeclarativemimetype/tst_qdeclarativemimetype.cpp
@@ -39,6 +39,15 @@
**
****************************************************************************/
+#include <QtCore/qglobal.h>
+
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
#include <QtQuickTest/quicktest.h>
QUICK_TEST_MAIN(mytest)
+#else
+int main()
+{
+ return 1;
+}
+#endif