From cd0785164bf166bd74b7d343433efef131bea336 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 9 Nov 2021 15:57:20 +0100 Subject: [PATCH] [partition] Fix compatibility with Qt 5.12 --- src/modules/partition/jobs/ClearMountsJob.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/modules/partition/jobs/ClearMountsJob.cpp b/src/modules/partition/jobs/ClearMountsJob.cpp index 8b339dea4..831a1e868 100644 --- a/src/modules/partition/jobs/ClearMountsJob.cpp +++ b/src/modules/partition/jobs/ClearMountsJob.cpp @@ -215,6 +215,12 @@ getPVGroups( const QString& deviceName ) * meant **only** for debugging and is not displayed to the user, * which is why no translation is applied. * + * The MessageAndPath class stores a C-style pointer to a character + * array -- from QT_TRANSLATE_NOOP() -- and a path to substitute into it. + * + * When the tryX() functions return an "empty string", it is an + * empty MessageAndPath which acts like an empty string (in particular, + * isEmpty() is true). */ class MessageAndPath @@ -237,8 +243,14 @@ public: } private: +#if ( QT_VERSION < QT_VERSION_CHECK( 5, 15, 0 ) ) + // TODO: 3.3 remove because newer Qt does support constness + const char* m_message = nullptr; + QString m_path; +#else const char* const m_message = nullptr; QString const m_path; +#endif }; STATICTEST inline QDebug&