Separate out the time, zone, date code from corelib/tools/
We'll be adding calendar code here as well, and tools/ was getting rather crowded, so it looks like time to move out a reasonably coherent sub-bundle of it all. Change-Id: I7e8030f38c31aa307f519dd918a43fc44baa6aa1 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
parent
29e3a4dfea
commit
548513a4bd
@ -105,12 +105,12 @@ DEPEND_SRC = \
|
|||||||
$(SOURCE_PATH)/src/corelib/serialization/qtextstream.cpp \
|
$(SOURCE_PATH)/src/corelib/serialization/qtextstream.cpp \
|
||||||
$(SOURCE_PATH)/src/corelib/serialization/qxmlstream.cpp \
|
$(SOURCE_PATH)/src/corelib/serialization/qxmlstream.cpp \
|
||||||
$(SOURCE_PATH)/src/corelib/serialization/qxmlutils.cpp \
|
$(SOURCE_PATH)/src/corelib/serialization/qxmlutils.cpp \
|
||||||
|
$(SOURCE_PATH)/src/corelib/time/qdatetime.cpp \
|
||||||
$(SOURCE_PATH)/src/corelib/tools/qarraydata.cpp \
|
$(SOURCE_PATH)/src/corelib/tools/qarraydata.cpp \
|
||||||
$(SOURCE_PATH)/src/corelib/tools/qbitarray.cpp \
|
$(SOURCE_PATH)/src/corelib/tools/qbitarray.cpp \
|
||||||
$(SOURCE_PATH)/src/corelib/tools/qbytearray.cpp\
|
$(SOURCE_PATH)/src/corelib/tools/qbytearray.cpp\
|
||||||
$(SOURCE_PATH)/src/corelib/tools/qbytearraymatcher.cpp \
|
$(SOURCE_PATH)/src/corelib/tools/qbytearraymatcher.cpp \
|
||||||
$(SOURCE_PATH)/src/corelib/tools/qcryptographichash.cpp \
|
$(SOURCE_PATH)/src/corelib/tools/qcryptographichash.cpp \
|
||||||
$(SOURCE_PATH)/src/corelib/tools/qdatetime.cpp \
|
|
||||||
$(SOURCE_PATH)/src/corelib/tools/qhash.cpp \
|
$(SOURCE_PATH)/src/corelib/tools/qhash.cpp \
|
||||||
$(SOURCE_PATH)/src/corelib/tools/qlist.cpp \
|
$(SOURCE_PATH)/src/corelib/tools/qlist.cpp \
|
||||||
$(SOURCE_PATH)/src/corelib/tools/qlocale.cpp \
|
$(SOURCE_PATH)/src/corelib/tools/qlocale.cpp \
|
||||||
@ -425,7 +425,7 @@ quuid.o: $(SOURCE_PATH)/src/corelib/plugin/quuid.cpp
|
|||||||
qfileinfo.o: $(SOURCE_PATH)/src/corelib/io/qfileinfo.cpp
|
qfileinfo.o: $(SOURCE_PATH)/src/corelib/io/qfileinfo.cpp
|
||||||
$(CXX) -c -o $@ $(CXXFLAGS) $<
|
$(CXX) -c -o $@ $(CXXFLAGS) $<
|
||||||
|
|
||||||
qdatetime.o: $(SOURCE_PATH)/src/corelib/tools/qdatetime.cpp
|
qdatetime.o: $(SOURCE_PATH)/src/corelib/time/qdatetime.cpp
|
||||||
$(CXX) -c -o $@ $(CXXFLAGS) $<
|
$(CXX) -c -o $@ $(CXXFLAGS) $<
|
||||||
|
|
||||||
qstringlist.o: $(SOURCE_PATH)/src/corelib/tools/qstringlist.cpp
|
qstringlist.o: $(SOURCE_PATH)/src/corelib/tools/qstringlist.cpp
|
||||||
|
@ -196,6 +196,9 @@ qmake_pch.obj:
|
|||||||
{$(SOURCE_PATH)\src\corelib\serialization}.cpp{}.obj::
|
{$(SOURCE_PATH)\src\corelib\serialization}.cpp{}.obj::
|
||||||
$(CXX) $(CXXFLAGS) $<
|
$(CXX) $(CXXFLAGS) $<
|
||||||
|
|
||||||
|
{$(SOURCE_PATH)\src\corelib\time}.cpp{}.obj::
|
||||||
|
$(CXX) $(CXXFLAGS) $<
|
||||||
|
|
||||||
{$(SOURCE_PATH)\src\corelib\tools}.cpp{}.obj::
|
{$(SOURCE_PATH)\src\corelib\tools}.cpp{}.obj::
|
||||||
$(CXX) $(CXXFLAGS) $<
|
$(CXX) $(CXXFLAGS) $<
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ qtConfig(animation): include(animation/animation.pri)
|
|||||||
include(global/global.pri)
|
include(global/global.pri)
|
||||||
include(thread/thread.pri)
|
include(thread/thread.pri)
|
||||||
include(tools/tools.pri)
|
include(tools/tools.pri)
|
||||||
|
include(time/time.pri)
|
||||||
include(io/io.pri)
|
include(io/io.pri)
|
||||||
include(itemmodels/itemmodels.pri)
|
include(itemmodels/itemmodels.pri)
|
||||||
include(plugin/plugin.pri)
|
include(plugin/plugin.pri)
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include "qtimezone.h"
|
#include "qtimezone.h"
|
||||||
#include "qlocale_p.h"
|
#include "private/qlocale_p.h"
|
||||||
#include "qvector.h"
|
#include "qvector.h"
|
||||||
|
|
||||||
#if QT_CONFIG(icu)
|
#if QT_CONFIG(icu)
|
@ -40,6 +40,7 @@
|
|||||||
#include "qtimezone.h"
|
#include "qtimezone.h"
|
||||||
#include "qtimezoneprivate_p.h"
|
#include "qtimezoneprivate_p.h"
|
||||||
#include "qdatetime_p.h" // ### Qt 5.14: remove once YearRange is on QDateTime
|
#include "qdatetime_p.h" // ### Qt 5.14: remove once YearRange is on QDateTime
|
||||||
|
#include "private/qlocale_tools_p.h"
|
||||||
|
|
||||||
#include <QtCore/QFile>
|
#include <QtCore/QFile>
|
||||||
#include <QtCore/QHash>
|
#include <QtCore/QHash>
|
||||||
@ -48,8 +49,6 @@
|
|||||||
|
|
||||||
#include <qdebug.h>
|
#include <qdebug.h>
|
||||||
|
|
||||||
#include "qlocale_tools_p.h"
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
34
src/corelib/time/time.pri
Normal file
34
src/corelib/time/time.pri
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
# Qt time / date / zone / calendar module
|
||||||
|
|
||||||
|
HEADERS += \
|
||||||
|
time/qdatetime.h \
|
||||||
|
time/qdatetime_p.h
|
||||||
|
|
||||||
|
SOURCES += time/qdatetime.cpp
|
||||||
|
|
||||||
|
qtConfig(timezone) {
|
||||||
|
HEADERS += \
|
||||||
|
time/qtimezone.h \
|
||||||
|
time/qtimezoneprivate_p.h \
|
||||||
|
time/qtimezoneprivate_data_p.h
|
||||||
|
SOURCES += \
|
||||||
|
time/qtimezone.cpp \
|
||||||
|
time/qtimezoneprivate.cpp
|
||||||
|
!nacl:darwin: {
|
||||||
|
SOURCES += time/qtimezoneprivate_mac.mm
|
||||||
|
} else: android:!android-embedded: {
|
||||||
|
SOURCES += time/qtimezoneprivate_android.cpp
|
||||||
|
} else: unix: {
|
||||||
|
SOURCES += time/qtimezoneprivate_tz.cpp
|
||||||
|
qtConfig(icu): SOURCES += time/qtimezoneprivate_icu.cpp
|
||||||
|
} else: qtConfig(icu): {
|
||||||
|
SOURCES += time/qtimezoneprivate_icu.cpp
|
||||||
|
} else: win32: {
|
||||||
|
SOURCES += time/qtimezoneprivate_win.cpp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
qtConfig(datetimeparser) {
|
||||||
|
HEADERS += time/qdatetimeparser_p.h
|
||||||
|
SOURCES += time/qdatetimeparser.cpp
|
||||||
|
}
|
@ -55,7 +55,7 @@
|
|||||||
#include "qlocale_p.h"
|
#include "qlocale_p.h"
|
||||||
#include "qlocale_tools_p.h"
|
#include "qlocale_tools_p.h"
|
||||||
#if QT_CONFIG(datetimeparser)
|
#if QT_CONFIG(datetimeparser)
|
||||||
#include "qdatetimeparser_p.h"
|
#include "private/qdatetimeparser_p.h"
|
||||||
#endif
|
#endif
|
||||||
#include "qnamespace.h"
|
#include "qnamespace.h"
|
||||||
#include "qdatetime.h"
|
#include "qdatetime.h"
|
||||||
|
@ -20,8 +20,6 @@ HEADERS += \
|
|||||||
tools/qcontainerfwd.h \
|
tools/qcontainerfwd.h \
|
||||||
tools/qcontainertools_impl.h \
|
tools/qcontainertools_impl.h \
|
||||||
tools/qcryptographichash.h \
|
tools/qcryptographichash.h \
|
||||||
tools/qdatetime.h \
|
|
||||||
tools/qdatetime_p.h \
|
|
||||||
tools/qdoublescanprint_p.h \
|
tools/qdoublescanprint_p.h \
|
||||||
tools/qeasingcurve.h \
|
tools/qeasingcurve.h \
|
||||||
tools/qfreelist_p.h \
|
tools/qfreelist_p.h \
|
||||||
@ -86,7 +84,6 @@ SOURCES += \
|
|||||||
tools/qbytearraymatcher.cpp \
|
tools/qbytearraymatcher.cpp \
|
||||||
tools/qcollator.cpp \
|
tools/qcollator.cpp \
|
||||||
tools/qcryptographichash.cpp \
|
tools/qcryptographichash.cpp \
|
||||||
tools/qdatetime.cpp \
|
|
||||||
tools/qeasingcurve.cpp \
|
tools/qeasingcurve.cpp \
|
||||||
tools/qfreelist.cpp \
|
tools/qfreelist.cpp \
|
||||||
tools/qhash.cpp \
|
tools/qhash.cpp \
|
||||||
@ -154,33 +151,6 @@ qtConfig(icu) {
|
|||||||
SOURCES += tools/qcollator_posix.cpp
|
SOURCES += tools/qcollator_posix.cpp
|
||||||
}
|
}
|
||||||
|
|
||||||
qtConfig(timezone) {
|
|
||||||
HEADERS += \
|
|
||||||
tools/qtimezone.h \
|
|
||||||
tools/qtimezoneprivate_p.h \
|
|
||||||
tools/qtimezoneprivate_data_p.h
|
|
||||||
SOURCES += \
|
|
||||||
tools/qtimezone.cpp \
|
|
||||||
tools/qtimezoneprivate.cpp
|
|
||||||
!nacl:darwin: {
|
|
||||||
SOURCES += tools/qtimezoneprivate_mac.mm
|
|
||||||
} else: android:!android-embedded: {
|
|
||||||
SOURCES += tools/qtimezoneprivate_android.cpp
|
|
||||||
} else: unix: {
|
|
||||||
SOURCES += tools/qtimezoneprivate_tz.cpp
|
|
||||||
qtConfig(icu): SOURCES += tools/qtimezoneprivate_icu.cpp
|
|
||||||
} else: qtConfig(icu): {
|
|
||||||
SOURCES += tools/qtimezoneprivate_icu.cpp
|
|
||||||
} else: win32: {
|
|
||||||
SOURCES += tools/qtimezoneprivate_win.cpp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
qtConfig(datetimeparser) {
|
|
||||||
HEADERS += tools/qdatetimeparser_p.h
|
|
||||||
SOURCES += tools/qdatetimeparser.cpp
|
|
||||||
}
|
|
||||||
|
|
||||||
qtConfig(regularexpression) {
|
qtConfig(regularexpression) {
|
||||||
QMAKE_USE_PRIVATE += pcre2
|
QMAKE_USE_PRIVATE += pcre2
|
||||||
|
|
||||||
|
@ -72,6 +72,7 @@ SOURCES += \
|
|||||||
../../corelib/serialization/qtextstream.cpp \
|
../../corelib/serialization/qtextstream.cpp \
|
||||||
../../corelib/serialization/qxmlutils.cpp \
|
../../corelib/serialization/qxmlutils.cpp \
|
||||||
../../corelib/serialization/qxmlstream.cpp \
|
../../corelib/serialization/qxmlstream.cpp \
|
||||||
|
../../corelib/time/qdatetime.cpp \
|
||||||
../../corelib/tools/qbitarray.cpp \
|
../../corelib/tools/qbitarray.cpp \
|
||||||
../../corelib/tools/qbytearray.cpp \
|
../../corelib/tools/qbytearray.cpp \
|
||||||
../../corelib/tools/qarraydata.cpp \
|
../../corelib/tools/qarraydata.cpp \
|
||||||
@ -79,7 +80,6 @@ SOURCES += \
|
|||||||
../../corelib/tools/qcommandlineparser.cpp \
|
../../corelib/tools/qcommandlineparser.cpp \
|
||||||
../../corelib/tools/qcommandlineoption.cpp \
|
../../corelib/tools/qcommandlineoption.cpp \
|
||||||
../../corelib/tools/qcryptographichash.cpp \
|
../../corelib/tools/qcryptographichash.cpp \
|
||||||
../../corelib/tools/qdatetime.cpp \
|
|
||||||
../../corelib/tools/qhash.cpp \
|
../../corelib/tools/qhash.cpp \
|
||||||
../../corelib/tools/qlist.cpp \
|
../../corelib/tools/qlist.cpp \
|
||||||
../../corelib/tools/qlinkedlist.cpp \
|
../../corelib/tools/qlinkedlist.cpp \
|
||||||
|
@ -14,4 +14,5 @@ SUBDIRS = \
|
|||||||
serialization \
|
serialization \
|
||||||
statemachine \
|
statemachine \
|
||||||
thread \
|
thread \
|
||||||
|
time \
|
||||||
tools
|
tools
|
||||||
|
6
tests/auto/corelib/time/time.pro
Normal file
6
tests/auto/corelib/time/time.pro
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
TEMPLATE = subdirs
|
||||||
|
SUBDIRS = \
|
||||||
|
qdate \
|
||||||
|
qdatetime \
|
||||||
|
qtime \
|
||||||
|
qtimezone
|
@ -16,8 +16,6 @@ SUBDIRS=\
|
|||||||
qcommandlineparser \
|
qcommandlineparser \
|
||||||
qcontiguouscache \
|
qcontiguouscache \
|
||||||
qcryptographichash \
|
qcryptographichash \
|
||||||
qdate \
|
|
||||||
qdatetime \
|
|
||||||
qeasingcurve \
|
qeasingcurve \
|
||||||
qexplicitlyshareddatapointer \
|
qexplicitlyshareddatapointer \
|
||||||
qfreelist \
|
qfreelist \
|
||||||
@ -62,8 +60,6 @@ SUBDIRS=\
|
|||||||
qstringref \
|
qstringref \
|
||||||
qstringview \
|
qstringview \
|
||||||
qtextboundaryfinder \
|
qtextboundaryfinder \
|
||||||
qtime \
|
|
||||||
qtimezone \
|
|
||||||
qtimeline \
|
qtimeline \
|
||||||
qvarlengtharray \
|
qvarlengtharray \
|
||||||
qvector \
|
qvector \
|
||||||
|
@ -5,6 +5,7 @@ SUBDIRS = \
|
|||||||
mimetypes \
|
mimetypes \
|
||||||
kernel \
|
kernel \
|
||||||
thread \
|
thread \
|
||||||
|
time \
|
||||||
tools \
|
tools \
|
||||||
codecs \
|
codecs \
|
||||||
plugin
|
plugin
|
||||||
|
5
tests/benchmarks/corelib/time/time.pro
Normal file
5
tests/benchmarks/corelib/time/time.pro
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
TEMPLATE = subdirs
|
||||||
|
SUBDIRS = \
|
||||||
|
qdate \
|
||||||
|
qdatetime \
|
||||||
|
qtimezone
|
@ -5,7 +5,6 @@ SUBDIRS = \
|
|||||||
qbytearray \
|
qbytearray \
|
||||||
qcontiguouscache \
|
qcontiguouscache \
|
||||||
qcryptographichash \
|
qcryptographichash \
|
||||||
qdatetime \
|
|
||||||
qlist \
|
qlist \
|
||||||
qlocale \
|
qlocale \
|
||||||
qmap \
|
qmap \
|
||||||
@ -15,7 +14,6 @@ SUBDIRS = \
|
|||||||
qstring \
|
qstring \
|
||||||
qstringbuilder \
|
qstringbuilder \
|
||||||
qstringlist \
|
qstringlist \
|
||||||
qtimezone \
|
|
||||||
qvector \
|
qvector \
|
||||||
qalgorithms
|
qalgorithms
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ Script to parse the CLDR supplemental/windowsZones.xml file and encode
|
|||||||
for use in QTimeZone. See ``./cldr2qlocalexml.py`` for where to get
|
for use in QTimeZone. See ``./cldr2qlocalexml.py`` for where to get
|
||||||
the CLDR data. Pass its common/ directory as first parameter to this
|
the CLDR data. Pass its common/ directory as first parameter to this
|
||||||
script and the qtbase root directory as second parameter. It shall
|
script and the qtbase root directory as second parameter. It shall
|
||||||
update qtbase's src/corelib/tools/qtimezoneprivate_data_p.h ready for
|
update qtbase's src/corelib/time/qtimezoneprivate_data_p.h ready for
|
||||||
use.
|
use.
|
||||||
|
|
||||||
The XML structure is as follows:
|
The XML structure is as follows:
|
||||||
@ -268,7 +268,7 @@ if not os.path.isdir(cldrPath) or not os.path.isdir(qtPath):
|
|||||||
|
|
||||||
windowsZonesPath = cldrPath + "/supplemental/windowsZones.xml"
|
windowsZonesPath = cldrPath + "/supplemental/windowsZones.xml"
|
||||||
tempFileDir = qtPath
|
tempFileDir = qtPath
|
||||||
dataFilePath = qtPath + "/src/corelib/tools/qtimezoneprivate_data_p.h"
|
dataFilePath = qtPath + "/src/corelib/time/qtimezoneprivate_data_p.h"
|
||||||
|
|
||||||
if not os.path.isfile(windowsZonesPath):
|
if not os.path.isfile(windowsZonesPath):
|
||||||
usage()
|
usage()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user