diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2024-02-26 15:29:20 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2024-03-18 14:59:26 +0100 |
commit | 4017bc5adc658efe6d7e8f57ee5f6f6a08b9dd9d (patch) | |
tree | b0c119868b059e67bcd5691485f34770ab65c009 | |
parent | 9b386127a091ff12229709b4a60ad6d4e8b05512 (diff) |
Introduce feature timezone_locale and begin implementing it
The feature remains disabled for now since its implementation is
incomplete. This facilitates introducing the various parts of it in
reviewable chunks, prior to actually plumbing it into the code that'll
end up using it and enabling it. Includes stubs of the files that
shall contain its source code.
Task-number: QTBUG-115158
Change-Id: Ie49251c0aaf5feaf1ff522e469479020e4c73065
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
-rw-r--r-- | src/corelib/CMakeLists.txt | 12 | ||||
-rw-r--r-- | src/corelib/configure.cmake | 6 | ||||
-rw-r--r-- | src/corelib/time/qtimezonelocale.cpp | 29 | ||||
-rw-r--r-- | src/corelib/time/qtimezonelocale_data_p.h | 39 | ||||
-rw-r--r-- | src/corelib/time/qtimezonelocale_p.h | 30 |
5 files changed, 116 insertions, 0 deletions
diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 83de88bd7e..43576b4aa4 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -922,6 +922,18 @@ qt_internal_extend_target(Core time/qtimezoneprivate_win.cpp ) +qt_internal_extend_target(Core + CONDITION QT_FEATURE_timezone_locale + SOURCES + time/qtimezonelocale.cpp time/qtimezonelocale_p.h +) + +qt_internal_extend_target(Core + CONDITION QT_FEATURE_timezone_locale AND NOT QT_FEATURE_icu + SOURCES + time/qtimezonelocale_data_p.h +) + qt_internal_extend_target(Core CONDITION QT_FEATURE_datetimeparser SOURCES time/qdatetimeparser.cpp time/qdatetimeparser_p.h diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index be628fcf04..58329d3b8f 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -805,6 +805,12 @@ qt_feature("timezone" PUBLIC PURPOSE "Provides support for time-zone handling." CONDITION NOT WASM AND NOT VXWORKS ) +qt_feature("timezone_locale" PRIVATE + SECTION "Utilities" + LABEL "QTimeZone" + PURPOSE "Provides support for localized time-zone display names." + DISABLE ON # Implementation is currently incomplete, so leave turned off +) qt_feature("datetimeparser" PRIVATE SECTION "Utilities" LABEL "QDateTimeParser" diff --git a/src/corelib/time/qtimezonelocale.cpp b/src/corelib/time/qtimezonelocale.cpp new file mode 100644 index 0000000000..5757e55d28 --- /dev/null +++ b/src/corelib/time/qtimezonelocale.cpp @@ -0,0 +1,29 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#include <private/qtimezonelocale_p.h> +#include <private/qtimezoneprivate_p.h> + +#if !QT_CONFIG(icu) // Use data generated from CLDR: +# include <private/qtimezonelocale_data_p.h> +# include <private/qtimezoneprivate_data_p.h> +#endif + +QT_BEGIN_NAMESPACE + +#if QT_CONFIG(icu) // Get data from ICU: +namespace QtTimeZoneLocale { + +} // QtTimeZoneLocale +#else // No ICU, use QTZ[LP}_data_p.h data for feature timezone_locale. +namespace { +using namespace QtTimeZoneLocale; // QTZL_data_p.h +using namespace QtTimeZoneCldr; // QTZP_data_p.h +// Accessors for the QTZL_data_p.h + +// Accessors for the QTZP_data_p.h + +} // nameless namespace +#endif // ICU + +QT_END_NAMESPACE diff --git a/src/corelib/time/qtimezonelocale_data_p.h b/src/corelib/time/qtimezonelocale_data_p.h new file mode 100644 index 0000000000..1cdbbaa952 --- /dev/null +++ b/src/corelib/time/qtimezonelocale_data_p.h @@ -0,0 +1,39 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: Unicode-3.0 + +#ifndef QTIMEZONELOCALE_DATA_P_H +#define QTIMEZONELOCALE_DATA_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of internal files. This header file may change from version to version +// without notice, or even be removed. +// +// We mean it. +// + +// Only qtimezonelocale.cpp should #include this (after other things it needs), +// and even that only when feature icu is disabled. +#include "qtimezonelocale_p.h" + +QT_REQUIRE_CONFIG(timezone_locale); +#if QT_CONFIG(icu) +# error "This file should only be needed (or seen) when ICU is not in use" +#endif + +QT_BEGIN_NAMESPACE + +namespace QtTimeZoneLocale { + +// GENERATED PART STARTS HERE + +// GENERATED PART ENDS HERE + +} // QtTimeZoneLocale + +QT_END_NAMESPACE + +#endif // QTIMEZONELOCALE_DATA_P_H diff --git a/src/corelib/time/qtimezonelocale_p.h b/src/corelib/time/qtimezonelocale_p.h new file mode 100644 index 0000000000..2b2c4451d8 --- /dev/null +++ b/src/corelib/time/qtimezonelocale_p.h @@ -0,0 +1,30 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QTIMEZONELOCALE_P_H +#define QTIMEZONELOCALE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of internal files. This header file may change from version to version +// without notice, or even be removed. +// +// We mean it. +// + +#include <QtCore/qtimezone.h> + +QT_REQUIRE_CONFIG(timezone_locale); + +namespace QtTimeZoneLocale { +#if QT_CONFIG(icu) +#else +// Define data types for QTZL_data_p.h + +#endif +} + +#endif // QTIMEZONELOCALE_P_H |