summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2017-02-21 13:30:14 +0100
committerMarc Mutz <marc.mutz@kdab.com>2017-02-23 05:45:49 +0000
commit4cd002402fe12f5e50d8267d0e9c39e525b99c2d (patch)
tree7d093a9c1bdab38e5bbc92665901842a889a54ac /src/corelib
parent2cda991ab19cbe115dfa965acc3686f067960773 (diff)
Simplify QTzTimeZonePrivate implementation
- Don't init m_icu with 0. It's a QSharedDataPointer, which inits to nullptr anyway. - The copy ctor didn't do anything out of the ordinary, so = default it. It's also only used in the implementation of clone(), so make it private. Removes three #if QT_CONFIG blocks. We can't use ctor delegation here, because systemTimeZoneId() is a virtual function. Change-Id: I2cd06c3349686b6f21c897acb5c12185a36d5b9f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/tools/qtimezoneprivate_p.h2
-rw-r--r--src/corelib/tools/qtimezoneprivate_tz.cpp16
2 files changed, 1 insertions, 17 deletions
diff --git a/src/corelib/tools/qtimezoneprivate_p.h b/src/corelib/tools/qtimezoneprivate_p.h
index 682edd3996..158c547f6a 100644
--- a/src/corelib/tools/qtimezoneprivate_p.h
+++ b/src/corelib/tools/qtimezoneprivate_p.h
@@ -287,12 +287,12 @@ Q_DECL_CONSTEXPR inline bool operator!=(const QTzTransitionRule &lhs, const QTzT
class Q_AUTOTEST_EXPORT QTzTimeZonePrivate Q_DECL_FINAL : public QTimeZonePrivate
{
+ QTzTimeZonePrivate(const QTzTimeZonePrivate &) = default;
public:
// Create default time zone
QTzTimeZonePrivate();
// Create named time zone
QTzTimeZonePrivate(const QByteArray &ianaId);
- QTzTimeZonePrivate(const QTzTimeZonePrivate &other);
~QTzTimeZonePrivate();
QTimeZonePrivate *clone() Q_DECL_OVERRIDE;
diff --git a/src/corelib/tools/qtimezoneprivate_tz.cpp b/src/corelib/tools/qtimezoneprivate_tz.cpp
index 9cbe339225..7cd5d6d506 100644
--- a/src/corelib/tools/qtimezoneprivate_tz.cpp
+++ b/src/corelib/tools/qtimezoneprivate_tz.cpp
@@ -615,32 +615,16 @@ static QVector<QTimeZonePrivate::Data> calculatePosixTransitions(const QByteArra
// Create the system default time zone
QTzTimeZonePrivate::QTzTimeZonePrivate()
-#if QT_CONFIG(icu)
- : m_icu(0)
-#endif
{
init(systemTimeZoneId());
}
// Create a named time zone
QTzTimeZonePrivate::QTzTimeZonePrivate(const QByteArray &ianaId)
-#if QT_CONFIG(icu)
- : m_icu(0)
-#endif
{
init(ianaId);
}
-QTzTimeZonePrivate::QTzTimeZonePrivate(const QTzTimeZonePrivate &other)
- : QTimeZonePrivate(other), m_tranTimes(other.m_tranTimes),
- m_tranRules(other.m_tranRules), m_abbreviations(other.m_abbreviations),
-#if QT_CONFIG(icu)
- m_icu(other.m_icu),
-#endif
- m_posixRule(other.m_posixRule)
-{
-}
-
QTzTimeZonePrivate::~QTzTimeZonePrivate()
{
}