diff --git a/benchmarks/common_top.pri b/benchmarks/common_top.pri index c978883b5..0521a635a 100644 --- a/benchmarks/common_top.pri +++ b/benchmarks/common_top.pri @@ -16,24 +16,13 @@ QT += testlib TEMPLATE = app # DEFINES += QT_NO_DEBUG_OUTPUT DEFINES += UNIT_TEST -equals(QT_MAJOR_VERSION, 4): target.path = $$[QT_INSTALL_LIBS]/libmlocale-benchmarks -equals(QT_MAJOR_VERSION, 5): target.path = $$[QT_INSTALL_LIBS]/libmlocale-benchmarks5 +target.path = $$[QT_INSTALL_LIBS]/libmlocale-benchmarks5 INSTALLS += target -equals(QT_MAJOR_VERSION, 4): LIBS += $$mAddLibrary(mlocale) -equals(QT_MAJOR_VERSION, 5): LIBS += $$mAddLibrary(mlocale5) +LIBS += $$mAddLibrary(mlocale5) support_files.files = -equals(QT_MAJOR_VERSION, 4): support_files.path = $$[QT_INSTALL_LIBS]/libmlocale-benchmarks -equals(QT_MAJOR_VERSION, 5): support_files.path = $$[QT_INSTALL_LIBS]/libmlocale-benchmarks5 +support_files.path = $$[QT_INSTALL_LIBS]/libmlocale-benchmarks5 INSTALLS += support_files CONFIG-=app_bundle - -equals(QT_MAJOR_VERSION, 4): DEFINES += '\'QTEST_GUILESS_MAIN(TestObject)=\ -int main(int argc, char *argv[]) \ -{ \ - QCoreApplication app(argc, argv); \ - TestObject tc; \ - return QTest::qExec(&tc, argc, argv); \ -}\'' diff --git a/benchmarks/pt_mcalendar/pt_mcalendar.cpp b/benchmarks/pt_mcalendar/pt_mcalendar.cpp index ec2ffbf13..81cd890e7 100644 --- a/benchmarks/pt_mcalendar/pt_mcalendar.cpp +++ b/benchmarks/pt_mcalendar/pt_mcalendar.cpp @@ -29,9 +29,6 @@ using ML10N::MCalendar; void Pt_MCalendar::initTestCase() { -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); -#endif QProcess process; process.start("sh -c \"dpkg -s libicu44 | grep Version | perl -pe 's/^Version:[[:space:]]*([^[[:space:]]+)$/$1/g'\""); if (!process.waitForFinished()) { diff --git a/benchmarks/pt_mcharsetdetector/pt_mcharsetdetector.cpp b/benchmarks/pt_mcharsetdetector/pt_mcharsetdetector.cpp index d2d58b44e..f02ff4a43 100644 --- a/benchmarks/pt_mcharsetdetector/pt_mcharsetdetector.cpp +++ b/benchmarks/pt_mcharsetdetector/pt_mcharsetdetector.cpp @@ -24,9 +24,6 @@ using ML10N::MCharsetMatch; void Pt_MCharsetDetector::initTestCase() { -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); -#endif } void Pt_MCharsetDetector::cleanupTestCase() diff --git a/benchmarks/pt_mlocale/pt_mlocale.cpp b/benchmarks/pt_mlocale/pt_mlocale.cpp index 0c8e9c85e..40c248279 100644 --- a/benchmarks/pt_mlocale/pt_mlocale.cpp +++ b/benchmarks/pt_mlocale/pt_mlocale.cpp @@ -26,9 +26,6 @@ using ML10N::MCollator; void Pt_MLocale::initTestCase() { -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); -#endif QProcess process; #ifdef HAVE_ICU process.start("sh -c \"dpkg -s libicu44 | grep Version | perl -pe 's/^Version:[[:space:]]*([^[[:space:]]+)$/$1/g'\""); diff --git a/benchmarks/pt_mlocationdatabase/pt_mlocationdatabase.cpp b/benchmarks/pt_mlocationdatabase/pt_mlocationdatabase.cpp index e0fd2b45c..812e71b3e 100644 --- a/benchmarks/pt_mlocationdatabase/pt_mlocationdatabase.cpp +++ b/benchmarks/pt_mlocationdatabase/pt_mlocationdatabase.cpp @@ -28,9 +28,6 @@ using ML10N::MLocationDatabase; void Pt_MLocationDatabase::initTestCase() { -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); -#endif } void Pt_MLocationDatabase::cleanupTestCase() diff --git a/benchmarks/shell.pri b/benchmarks/shell.pri index ece53eef3..49f1761b4 100644 --- a/benchmarks/shell.pri +++ b/benchmarks/shell.pri @@ -4,8 +4,7 @@ shell_scripts.CONFIG += no_check_exist include(../mkspecs/common.pri) -equals(QT_MAJOR_VERSION, 4): shell_scripts.path += $$ML_INSTALL_DATA/libmlocale-benchmarks -equals(QT_MAJOR_VERSION, 5): shell_scripts.path += $$ML_INSTALL_DATA/libmlocale-benchmarks5 +shell_scripts.path += $$ML_INSTALL_DATA/libmlocale-benchmarks5 shell_scripts.depends = FORCE INSTALLS += \ diff --git a/configure b/configure index 316a41539..aa5688438 100755 --- a/configure +++ b/configure @@ -501,7 +501,7 @@ fi # substitute prefix in .pc files MEEGOTOUCH_PC_DIR="$outpath/src/data" -MEEGOTOUCH_PC_FILES="mlocale mlocale5" +MEEGOTOUCH_PC_FILES="mlocale5" # make sure the directory exists if [ ! -d $MEEGOTOUCH_PC_DIR ]; then @@ -551,8 +551,8 @@ if [ -z "$QMAKE_BIN" ]; then fi # now check for qt version -QT_MAJOR_VERSION_NEEDED=4 -QT_MINOR_VERSION_NEEDED=7 +QT_MAJOR_VERSION_NEEDED=5 +QT_MINOR_VERSION_NEEDED=0 QT_VERSION=$($QMAKE_BIN -query QT_VERSION) diff --git a/mkspecs/features/mlocale_defines.prf.in b/mkspecs/features/mlocale_defines.prf.in index 373602069..d5f409bbb 100644 --- a/mkspecs/features/mlocale_defines.prf.in +++ b/mkspecs/features/mlocale_defines.prf.in @@ -28,13 +28,10 @@ win32 { ML_INSTALL_BIN = $$ML_PREFIX/bin ML_INSTALL_LIBS = $$ML_LIBDIR ML_INSTALL_DATA = $$ML_PREFIX/share -equals(QT_MAJOR_VERSION, 4): ML_INSTALL_HEADERS = $$ML_PREFIX/include/mlocale -equals(QT_MAJOR_VERSION, 5): ML_INSTALL_HEADERS = $$ML_PREFIX/include/mlocale5 -equals(QT_MAJOR_VERSION, 4): ML_TRANSLATION_DIR = $$ML_INSTALL_DATA/l10n/mlocale -equals(QT_MAJOR_VERSION, 5): ML_TRANSLATION_DIR = $$ML_INSTALL_DATA/l10n/mlocale5 +ML_INSTALL_HEADERS = $$ML_PREFIX/include/mlocale5 +ML_TRANSLATION_DIR = $$ML_INSTALL_DATA/l10n/mlocale5 -equals(QT_MAJOR_VERSION, 4): unix|win32: ML_ICUEXTRADATA_DIR = $$ML_INSTALL_DATA/mlocale/icu -equals(QT_MAJOR_VERSION, 5): unix|win32: ML_ICUEXTRADATA_DIR = $$ML_INSTALL_DATA/mlocale5/icu +ML_ICUEXTRADATA_DIR = $$ML_INSTALL_DATA/mlocale5/icu win32: ML_INSTALL_LIBS = $$ML_PREFIX/bin defineReplace(mAddLibrary) { diff --git a/src/data/mlocale.pc.in b/src/data/mlocale.pc.in deleted file mode 100644 index 5c635971c..000000000 --- a/src/data/mlocale.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@@M_UNIX_INSTALL_PREFIX@@ -exec_prefix=${prefix} -libdir=${exec_prefix}/lib -includedir=${prefix}/include/mlocale - -Name: mlocale -Description: MeeGo Locale Library -Version: @@M_VERSION@@ -Requires: QtGui -Cflags: -I${includedir} -Libs: -L${libdir} -lmlocale diff --git a/src/mcalendar.cpp b/src/mcalendar.cpp index d39a45e6e..171049589 100644 --- a/src/mcalendar.cpp +++ b/src/mcalendar.cpp @@ -288,14 +288,7 @@ void MCalendar::setDateTime(QDateTime dateTime) // We cannot use QDateTime::toTime_t because this // works only for dates after 1970-01-01T00:00:00.000. -#if QT_VERSION >= 0x040700 UDate icuDate = dateTime.toMSecsSinceEpoch(); -#else - // Qt < 4.7 lacks QDateTime::toMSecsSinceEpoch(), we need to emulate it: - int days = QDate(1970, 1, 1).daysTo(dateTime.date()); - qint64 msecs = qint64(QTime().secsTo(dateTime.time())) * 1000; - UDate icuDate = (qint64(days) * MSECS_PER_DAY) + msecs; -#endif if (originalTimeSpec == Qt::LocalTime) { // convert from local time to UTC @@ -335,21 +328,7 @@ QDateTime MCalendar::qDateTime(Qt::TimeSpec spec) const QDateTime dateTime; // avoid conversions by Qt dateTime.setTimeSpec(Qt::UTC); -#if QT_VERSION >= 0x040700 dateTime.setMSecsSinceEpoch(qint64(icuDate)); -#else - // Qt < 4.7 lacks QDateTime::setMSecsSinceEpoch(), we need to emulate it. - qint64 msecs = qint64(icuDate); - int ddays = msecs / MSECS_PER_DAY; - msecs %= MSECS_PER_DAY; - if (msecs < 0) { - // negative - --ddays; - msecs += MSECS_PER_DAY; - } - dateTime.setDate(QDate(1970, 1, 1).addDays(ddays)); - dateTime.setTime(QTime().addMSecs(msecs)); -#endif // note: we set time spec after time value so Qt will not any // conversions of its own to UTC. We might let Qt handle it but // this might be more robust diff --git a/src/mcity.cpp b/src/mcity.cpp index 2d1f4dec9..cb7c9260a 100644 --- a/src/mcity.cpp +++ b/src/mcity.cpp @@ -134,14 +134,7 @@ qint32 MCity::timeZoneDstOffset(QDateTime dateTime) const UBool local = dateTime.timeSpec() == Qt::LocalTime? true : false; // we avoid time conversions done by Qt: dateTime.setTimeSpec(Qt::UTC); -#if QT_VERSION >= 0x040700 UDate icuDate = dateTime.toMSecsSinceEpoch(); -#else - // Qt < 4.7 lacks QDateTime::toMSecsSinceEpoch(), we need to emulate it: - int days = QDate(1970, 1, 1).daysTo(dateTime.date()); - qint64 msecs = qint64(QTime().secsTo(dateTime.time())) * 1000; - UDate icuDate = (qint64(days) * MSECS_PER_DAY) + msecs; -#endif icu::TimeZone *tz = TimeZone::createTimeZone(MIcuConversions::qStringToUnicodeString(d->timeZone)); qint32 rawOffset; @@ -163,14 +156,7 @@ qint32 MCity::timeZoneTotalOffset(QDateTime dateTime) const UBool local = dateTime.timeSpec() == Qt::LocalTime? true : false; // we avoid time conversions done by Qt: dateTime.setTimeSpec(Qt::UTC); -#if QT_VERSION >= 0x040700 UDate icuDate = dateTime.toMSecsSinceEpoch(); -#else - // Qt < 4.7 lacks QDateTime::toMSecsSinceEpoch(), we need to emulate it: - int days = QDate(1970, 1, 1).daysTo(dateTime.date()); - qint64 msecs = qint64(QTime().secsTo(dateTime.time())) * 1000; - UDate icuDate = (qint64(days) * MSECS_PER_DAY) + msecs; -#endif icu::TimeZone *tz = TimeZone::createTimeZone(MIcuConversions::qStringToUnicodeString(d->timeZone)); qint32 rawOffset; diff --git a/src/src.pro b/src/src.pro index f36891ed1..0f6e8e256 100644 --- a/src/src.pro +++ b/src/src.pro @@ -6,8 +6,7 @@ include(common_top.pri) QT += xml QT -= gui -equals(QT_MAJOR_VERSION, 4): TARGET = mlocale -equals(QT_MAJOR_VERSION, 5): TARGET = mlocale5 +TARGET = mlocale5 INCLUDEPATH += . @@ -104,8 +103,7 @@ INSTALLS += install_prf # install pkgconfig file install_pkgconfig.path = $$ML_INSTALL_LIBS/pkgconfig -equals(QT_MAJOR_VERSION, 4): install_pkgconfig.files = data/mlocale.pc -equals(QT_MAJOR_VERSION, 5): install_pkgconfig.files = data/mlocale5.pc +install_pkgconfig.files = data/mlocale5.pc INSTALLS += install_pkgconfig diff --git a/tests/common_top.pri b/tests/common_top.pri index 86ccf086b..92d35e648 100644 --- a/tests/common_top.pri +++ b/tests/common_top.pri @@ -19,22 +19,11 @@ QT += testlib TEMPLATE = app # DEFINES += QT_NO_DEBUG_OUTPUT DEFINES += UNIT_TEST -equals(QT_MAJOR_VERSION, 4): target.path = $$[QT_INSTALL_LIBS]/libmlocale-tests -equals(QT_MAJOR_VERSION, 5): target.path = $$[QT_INSTALL_LIBS]/libmlocale-tests5 +target.path = $$[QT_INSTALL_LIBS]/libmlocale-tests5 INSTALLS += target -equals(QT_MAJOR_VERSION, 4): LIBS += $$mAddLibrary(mlocale) -equals(QT_MAJOR_VERSION, 5): LIBS += $$mAddLibrary(mlocale5) +LIBS += $$mAddLibrary(mlocale5) support_files.files = -equals(QT_MAJOR_VERSION, 4): support_files.path = $$[QT_INSTALL_LIBS]/libmlocale-tests -equals(QT_MAJOR_VERSION, 5): support_files.path = $$[QT_INSTALL_LIBS]/libmlocale-tests5 +support_files.path = $$[QT_INSTALL_LIBS]/libmlocale-tests5 INSTALLS += support_files - -equals(QT_MAJOR_VERSION, 4): DEFINES += '\'QTEST_GUILESS_MAIN(TestObject)=\ -int main(int argc, char *argv[]) \ -{ \ - QCoreApplication app(argc, argv); \ - TestObject tc; \ - return QTest::qExec(&tc, argc, argv); \ -}\'' diff --git a/tests/ft_breakiterator/ft_breakiterator.cpp b/tests/ft_breakiterator/ft_breakiterator.cpp index 0053bce91..8181bfa61 100644 --- a/tests/ft_breakiterator/ft_breakiterator.cpp +++ b/tests/ft_breakiterator/ft_breakiterator.cpp @@ -37,9 +37,6 @@ class TestBreakIterator : public MBreakIterator void Ft_BreakIterator::initTestCase() { -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); -#endif } void Ft_BreakIterator::cleanupTestCase() diff --git a/tests/ft_localedata/ft_localedata.cpp b/tests/ft_localedata/ft_localedata.cpp index 9488e6d2b..80d42411b 100644 --- a/tests/ft_localedata/ft_localedata.cpp +++ b/tests/ft_localedata/ft_localedata.cpp @@ -23,9 +23,6 @@ using ML10N::MLocale; void Ft_LocaleData::initTestCase() { -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); -#endif MLocale::setDataPath(qApp->applicationDirPath()); } diff --git a/tests/ft_locales/ft_locales.cpp b/tests/ft_locales/ft_locales.cpp index 4a5673b0a..f6ffa5e13 100644 --- a/tests/ft_locales/ft_locales.cpp +++ b/tests/ft_locales/ft_locales.cpp @@ -31,9 +31,6 @@ class TestLocale : public MLocale void Ft_Locales::initTestCase() { -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); -#endif QProcess process; process.start("sh -c \"dpkg -s libqtcore4 | grep Version | perl -pe 's/^Version:[[:space:]]*([^[[:space:]]+)$/$1/g'\""); if (!process.waitForFinished()) { @@ -949,59 +946,19 @@ void Ft_Locales::testMLocaleToLower_data() << QString("größe") ; -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - if(libqtcore4PackageVersion >= "4.7.2~git20110119" - && libqtcore4PackageVersion < "4.7.4~git20110516-0maemo2") { // Qt uses libicu - QTest::newRow("de_DE") - << QString("de_DE") - << QString("GRÖẞE") - << QString("größe") - << QString("größe") // works because Qt’s toLower uses libicu now - ; - } - else { - QTest::newRow("de_DE") - << QString("de_DE") - << QString("GRÖẞE") - << QString("größe") - << QString("gröẞe") // Qt bug? - ; - } -#else QTest::newRow("de_DE") << QString("de_DE") << QString("GRÖẞE") << QString("größe") << QString("größe") ; -#endif -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - if(libqtcore4PackageVersion >= "4.7.2~git20110119" - && libqtcore4PackageVersion < "4.7.4~git20110516-0maemo2") { // Qt uses libicu - QTest::newRow("de_CH") // no difference in behaviour to de_CH here - << QString("de_CH") - << QString("GRÖẞE") - << QString("größe") - << QString("größe") // works because Qt’s toLower uses libicu now - ; - } - else { - QTest::newRow("de_CH") // no difference in behaviour to de_CH here - << QString("de_CH") - << QString("GRÖẞE") - << QString("größe") - << QString("gröẞe") // Qt bug? - ; - } -#else QTest::newRow("de_CH") // no difference in behaviour to de_CH here << QString("de_CH") << QString("GRÖẞE") << QString("größe") << QString("größe") ; -#endif QTest::newRow("en_GB") << QString("en_GB") @@ -4039,11 +3996,7 @@ void Ft_Locales::testMLocaleIndexBucket() // we need to instantiate a MLocale before dataPaths returns // a valid result. MLocale locale(localeName); -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - QCOMPARE(MLocale::dataPaths(), (QStringList() << "/usr/share/mlocale/icu")); -#else QCOMPARE(MLocale::dataPaths(), (QStringList() << "/usr/share/mlocale5/icu")); -#endif MLocale localeEn("en_US"); locale.setCategoryLocale(MLocale::MLcCollate, lcCollate); @@ -4206,11 +4159,7 @@ void Ft_Locales::testDifferentStrengthComparison() QFETCH(QString, string2); QFETCH(QList, comparisonExpectedResults); -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - QCOMPARE(MLocale::dataPaths(), (QStringList() << "/usr/share/mlocale/icu")); -#else QCOMPARE(MLocale::dataPaths(), (QStringList() << "/usr/share/mlocale5/icu")); -#endif MLocale locale(localeName); locale.setCategoryLocale(MLocale::MLcCollate, lcCollate); MCollator collator = locale.collator(); @@ -4618,11 +4567,7 @@ void Ft_Locales::checkAvailableLocales() QString ft_localesTestOutput = ""; foreach(QString supportedLocaleName, supportedLocaleNames) { MLocale locale(supportedLocaleName); -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - QCOMPARE(MLocale::dataPaths(), (QStringList() << "/usr/share/mlocale/icu")); -#else QCOMPARE(MLocale::dataPaths(), (QStringList() << "/usr/share/mlocale5/icu")); -#endif locale.setTimeFormat24h(MLocale::LocaleDefaultTimeFormat24h); QCOMPARE(locale.timeFormat24h(), MLocale::LocaleDefaultTimeFormat24h); qSort(sortingTestList.begin(), sortingTestList.end(), locale.collator()); diff --git a/tests/ft_mcharsetdetector/ft_mcharsetdetector.cpp b/tests/ft_mcharsetdetector/ft_mcharsetdetector.cpp index 7312fdcde..a7395df47 100644 --- a/tests/ft_mcharsetdetector/ft_mcharsetdetector.cpp +++ b/tests/ft_mcharsetdetector/ft_mcharsetdetector.cpp @@ -26,9 +26,6 @@ using ML10N::MCharsetDetector; void Ft_MCharsetDetector::initTestCase() { -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); -#endif } void Ft_MCharsetDetector::cleanupTestCase() diff --git a/tests/ft_mlocalebuckets/ft_mlocalebuckets.cpp b/tests/ft_mlocalebuckets/ft_mlocalebuckets.cpp index 7a7e86180..2e6da97b4 100644 --- a/tests/ft_mlocalebuckets/ft_mlocalebuckets.cpp +++ b/tests/ft_mlocalebuckets/ft_mlocalebuckets.cpp @@ -43,11 +43,6 @@ QStringList inputItems; void Ft_MLocaleBuckets::initTestCase() { - // This is important for string constants with non-ASCII characters: -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); -#endif - inputItems << "Ömer" // 0 << "Yannick" // 1 diff --git a/tests/ft_mstringsearch/ft_mstringsearch.cpp b/tests/ft_mstringsearch/ft_mstringsearch.cpp index 92dd7969b..56c9a3c4b 100644 --- a/tests/ft_mstringsearch/ft_mstringsearch.cpp +++ b/tests/ft_mstringsearch/ft_mstringsearch.cpp @@ -27,9 +27,6 @@ using ML10N::MStringSearch; void Ft_MStringSearch::initTestCase() { -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); -#endif } void Ft_MStringSearch::cleanupTestCase() diff --git a/tests/ft_numbers/ft_numbers.cpp b/tests/ft_numbers/ft_numbers.cpp index 9ec405bed..98abc2f4e 100644 --- a/tests/ft_numbers/ft_numbers.cpp +++ b/tests/ft_numbers/ft_numbers.cpp @@ -25,9 +25,6 @@ using ML10N::MLocale; void Ft_Numbers::initTestCase() { -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); -#endif QProcess process; process.start("sh -c \"dpkg -s libicu44 | grep Version | perl -pe 's/^Version:[[:space:]]*([^[[:space:]]+)$/$1/g'\""); if (!process.waitForFinished()) { diff --git a/tests/ft_sorting/ft_sorting.cpp b/tests/ft_sorting/ft_sorting.cpp index 8ad8f5b3e..df142dc99 100644 --- a/tests/ft_sorting/ft_sorting.cpp +++ b/tests/ft_sorting/ft_sorting.cpp @@ -38,9 +38,6 @@ class TestCollator : public MCollator void Ft_Sorting::initTestCase() { -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); -#endif QProcess process; process.start("sh -c \"dpkg -s libicu44 | grep Version | perl -pe 's/^Version:[[:space:]]*([^[[:space:]]+)$/$1/g'\""); if (!process.waitForFinished()) { diff --git a/tests/shell.pri b/tests/shell.pri index 09a2cec45..0b74a1485 100644 --- a/tests/shell.pri +++ b/tests/shell.pri @@ -1,5 +1,4 @@ -equals(QT_MAJOR_VERSION, 4): ml_unittest_install_path = $$[QT_INSTALL_LIBS]/libmlocale-tests -equals(QT_MAJOR_VERSION, 5): ml_unittest_install_path = $$[QT_INSTALL_LIBS]/libmlocale-tests5 +ml_unittest_install_path = $$[QT_INSTALL_LIBS]/libmlocale-tests5 shell_scripts.commands += $$PWD/gen-tests-xml.sh $${ml_unittest_install_path} > $$OUT_PWD/tests.xml shell_scripts.files += $$OUT_PWD/tests.xml @@ -7,8 +6,7 @@ shell_scripts.CONFIG += no_check_exist include(../mkspecs/common.pri) -equals(QT_MAJOR_VERSION, 4): shell_scripts.path += $$ML_INSTALL_DATA/libmlocale-tests -equals(QT_MAJOR_VERSION, 5): shell_scripts.path += $$ML_INSTALL_DATA/libmlocale-tests5 +shell_scripts.path += $$ML_INSTALL_DATA/libmlocale-tests5 shell_scripts.path += $$ML_INSTALL_DATA/libmlocale-tests shell_scripts.depends = FORCE diff --git a/tests/ut_mcalendar/ut_mcalendar.cpp b/tests/ut_mcalendar/ut_mcalendar.cpp index c06e510fa..27224de70 100644 --- a/tests/ut_mcalendar/ut_mcalendar.cpp +++ b/tests/ut_mcalendar/ut_mcalendar.cpp @@ -54,9 +54,6 @@ static QString maybeEmbedDateTimeString(const QString &dateTimeString, const MLo void Ut_MCalendar::initTestCase() { -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); -#endif QProcess process; process.start("sh -c \"dpkg -s libicu44 | grep Version | perl -pe 's/^Version:[[:space:]]*([^[[:space:]]+)$/$1/g'\""); if (!process.waitForFinished()) { @@ -91,11 +88,7 @@ void Ut_MCalendar::cleanup() void Ut_MCalendar::testDataPaths() { MLocale locale; -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - QCOMPARE(MLocale::dataPaths(), (QStringList() << "/usr/share/mlocale/icu")); -#else QCOMPARE(MLocale::dataPaths(), (QStringList() << "/usr/share/mlocale5/icu")); -#endif } void Ut_MCalendar::testTimeZones() diff --git a/tests/ut_mlocationdatabase/ut_mlocationdatabase.cpp b/tests/ut_mlocationdatabase/ut_mlocationdatabase.cpp index e7c19e8c7..a5a0e3169 100644 --- a/tests/ut_mlocationdatabase/ut_mlocationdatabase.cpp +++ b/tests/ut_mlocationdatabase/ut_mlocationdatabase.cpp @@ -47,9 +47,6 @@ class TestCountry : public MCountry void Ut_MLocationDatabase::initTestCase() { -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); -#endif } void Ut_MLocationDatabase::cleanupTestCase() @@ -645,10 +642,8 @@ void Ut_MLocationDatabase::testCitiesDumpInfo() // This test dumps lots of information from the database to detect // changes and serves as a simple benchmark whether all the // information can be gathered in reasonable time. -#if QT_VERSION >= 0x040700 QElapsedTimer timer; timer.start(); -#endif MLocationDatabase db; QList cities = db.cities(); @@ -786,10 +781,8 @@ void Ut_MLocationDatabase::testCitiesDumpInfo() // what has changed: QProcess::execute("diff -u " + ut_mlocationdatabaseTestInputFileName + ' ' + ut_mlocationdatabaseTestOutputFileName); } -#if QT_VERSION >= 0x040700 debugStream << __PRETTY_FUNCTION__ << " took " << timer.restart() << " milliseconds "; #endif -#endif } void Ut_MLocationDatabase::testTimeZoneOffsets() diff --git a/tests/ut_mlocationdatabase/ut_mlocationdatabase.h b/tests/ut_mlocationdatabase/ut_mlocationdatabase.h index 7591cd588..da7547971 100644 --- a/tests/ut_mlocationdatabase/ut_mlocationdatabase.h +++ b/tests/ut_mlocationdatabase/ut_mlocationdatabase.h @@ -22,9 +22,7 @@ #include #include -#if QT_VERSION >= 0x040700 #include -#endif #include #include diff --git a/tests/ut_translations/translations-qttrid/translations-qttrid.pro b/tests/ut_translations/translations-qttrid/translations-qttrid.pro index c0eb5d94c..a8088bcfa 100644 --- a/tests/ut_translations/translations-qttrid/translations-qttrid.pro +++ b/tests/ut_translations/translations-qttrid/translations-qttrid.pro @@ -10,8 +10,7 @@ LANGUAGES = ar_EG en_GB de_DE CATALOGNAME = ut_translations-qttrid SOURCEDIR = $$PWD/.. TRANSLATIONDIR = $$PWD -equals(QT_MAJOR_VERSION, 4): TRANSLATION_INSTALLDIR = $$[QT_INSTALL_LIBS]/libmlocale-tests/translations-qttrid -equals(QT_MAJOR_VERSION, 5): TRANSLATION_INSTALLDIR = $$[QT_INSTALL_LIBS]/libmlocale-tests5/translations-qttrid +TRANSLATION_INSTALLDIR = $$[QT_INSTALL_LIBS]/libmlocale-tests5/translations-qttrid # these include files are installed to $$[QT_INSTALL_DATA]/mkspecs/features # and included in the "libmlocale-dev" package: include($${M_BUILD_TREE}/mkspecs/features/mlocale_defines.prf) diff --git a/tests/ut_translations/translations-tr/translations-tr.pro b/tests/ut_translations/translations-tr/translations-tr.pro index 779675fe9..d714b0fa5 100644 --- a/tests/ut_translations/translations-tr/translations-tr.pro +++ b/tests/ut_translations/translations-tr/translations-tr.pro @@ -11,8 +11,7 @@ DISABLE_QTTRID_ENGINEERING_ENGLISH = yes CATALOGNAME = ut_translations-tr SOURCEDIR = $$PWD/.. TRANSLATIONDIR = $$PWD -equals(QT_MAJOR_VERSION, 4): TRANSLATION_INSTALLDIR = $$[QT_INSTALL_LIBS]/libmlocale-tests/translations-tr -equals(QT_MAJOR_VERSION, 5): TRANSLATION_INSTALLDIR = $$[QT_INSTALL_LIBS]/libmlocale-tests5/translations-tr +TRANSLATION_INSTALLDIR = $$[QT_INSTALL_LIBS]/libmlocale-tests5/translations-tr # add “-verbose” to force without “-idbased” which is the default in translations.pri LRELEASE_OPTIONS = "-verbose" diff --git a/tests/ut_translations/ut_translations.cpp b/tests/ut_translations/ut_translations.cpp index e2ebee5be..044706bcb 100644 --- a/tests/ut_translations/ut_translations.cpp +++ b/tests/ut_translations/ut_translations.cpp @@ -26,9 +26,6 @@ using ML10N::MLocale; void Ut_Translations::initTestCase() { qap = QCoreApplication::instance(); -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); -#endif } void Ut_Translations::cleanupTestCase()