Summary: | Fails to build with Qt < 5.8 (missing Qt::ISODateWithMs) | ||
---|---|---|---|
Product: | [Frameworks and Libraries] KDb | Reporter: | Wolfgang Bauer <wbauer1> |
Component: | General | Assignee: | Jarosław Staniek <staniek> |
Status: | CLOSED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 3.2.0 Beta | ||
Target Milestone: | 3.2 | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/kdb/fc9713255aee4535ac0b0f255a3457355c01f3ba | Version Fixed In: | 3.2.0 |
Description
Wolfgang Bauer
2019-02-20 15:02:32 UTC
Thanks, fixing it, I was convinced it's in all Qt 5 but it's not: https://bugreports.qt.io/browse/QTBUG-59235 Git commit d6291d605ac6e3355210512c0f1f039e9d5d5a74 by Jaroslaw Staniek. Committed on 08/03/2019 at 21:15. Pushed by staniek into branch '3.2'. Fix build with Qt < 5.8 (missing Qt::ISODateWithMs) Add some replacement implementation. Add autotests. FIXED-IN:3.2.0 M +1 -0 autotests/tools/CMakeLists.txt A +163 -0 autotests/tools/UtilsTest.cpp [License: LGPL (v2+)] M +9 -0 src/CMakeLists.txt M +2 -2 src/KDbField.cpp M +57 -1 src/tools/KDbUtils.cpp M +47 -1 src/tools/KDbUtils.h https://commits.kde.org/kdb/d6291d605ac6e3355210512c0f1f039e9d5d5a74 It's not fixed yet. https://commits.kde.org/kdb/d6291d605ac6e3355210512c0f1f039e9d5d5a74 adds new functions that should work also with older Qt versions, but the existing code is unchanged and still uses Qt::ISODateWithMs unconditionally. Btw, "if(Qt5_VERSION VERSION_GREATER_EQUAL ${QT_ISODATEWITHMS_MIN_VERSION})" requires at least cmake 3.7, VERSION_GREATER_EQUAL didn't exist before. It would probably be better to use VERSION_LESS instead (and swap the if/else branches), which would also work with older cmake versions. Thanks for the detailed notes, Wolfgang. It will be updated. I've not used the code review feature (Phabricator) before pushing because we lack reviewers so there would be too big delays. So we have post-review, like this. If you feel otherwise - that you're able to review things please share your opinions. Git commit fc9713255aee4535ac0b0f255a3457355c01f3ba by Jaroslaw Staniek. Committed on 09/03/2019 at 21:02. Pushed by staniek into branch '3.2'. Port KDb to the Qt::ISODateWithMs fix FIXED-IN:3.2.0 M +4 -4 src/CMakeLists.txt M +2 -2 src/KDb.cpp M +4 -5 src/KDb.h M +2 -2 src/KDbField.cpp M +2 -2 src/drivers/postgresql/PostgresqlCursor.cpp M +1 -1 src/drivers/sqlite/SqliteCursor.cpp M +2 -2 src/drivers/sqlite/SqlitePreparedStatement.cpp https://commits.kde.org/kdb/fc9713255aee4535ac0b0f255a3457355c01f3ba *Nearly* fixed, but there is one error left: /home/abuild/rpmbuild/BUILD/kdb-3.1.91/src/tools/KDbUtils.cpp: In function 'QDateTime KDbUtils::stringToHackedQTime(const QString&)': /home/abuild/rpmbuild/BUILD/kdb-3.1.91/src/tools/KDbUtils.cpp:203:59: error: 'ISODateWithMs' is not a member of 'Qt' return QDateTime(QDate(0, 1, 2), QTime::fromString(s, Qt::ISODateWithMs)); ^ Changing that line to use the corresponding new function (KDbUtils::timeFromISODateStringWithMs(s) ) makes it compile successfully, so this is really the last one... ;-) Git commit 630853810bc1d048d7e580740b05cdb311830340 by Jaroslaw Staniek. Committed on 12/03/2019 at 17:15. Pushed by staniek into branch '3.2'. Port KDbUtils::stringToHackedQTime the Qt::ISODateWithMs fix FIXED-IN:3.2.0 M +1 -3 src/tools/KDbUtils.cpp https://commits.kde.org/kdb/630853810bc1d048d7e580740b05cdb311830340 Thanks again Wolfgang! I can confirm that the latest source in the 3.2 branch compiles fine now with Qt 5.6.2 (and also 5.5.1). |