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>
This commit is contained in:
Edward Welbourne 2024-02-26 15:29:20 +01:00
parent 9b386127a0
commit 4017bc5adc
5 changed files with 116 additions and 0 deletions

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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