From: Jedrzej Nowacki Date: Fri, 10 Jun 2011 08:47:07 +0000 (+0200) Subject: Cleanup reference counting in QDateTimePrivate class. X-Git-Tag: qt-v5.0.0-alpha1~4008 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9fea02400c450b4b1a031506655d8c4b165cecd6;p=profile%2Fivi%2Fqtbase.git Cleanup reference counting in QDateTimePrivate class. It is better to use QSharedData which is a common interface for ref counting. Change-Id: I990476d6763901bf383f241bce16fe26665b021c Reviewed-on: http://codereview.qt.nokia.com/1439 Reviewed-by: Qt Sanity Bot Reviewed-by: Olivier Goffart --- diff --git a/src/corelib/tools/qdatetime_p.h b/src/corelib/tools/qdatetime_p.h index 8d931dc..c20f212 100644 --- a/src/corelib/tools/qdatetime_p.h +++ b/src/corelib/tools/qdatetime_p.h @@ -76,17 +76,16 @@ QT_BEGIN_NAMESPACE -class QDateTimePrivate +class QDateTimePrivate : public QSharedData { public: enum Spec { LocalUnknown = -1, LocalStandard = 0, LocalDST = 1, UTC = 2, OffsetFromUTC = 3}; QDateTimePrivate() : spec(LocalUnknown), utcOffset(0) {} QDateTimePrivate(const QDateTimePrivate &other) - : date(other.date), time(other.time), spec(other.spec), utcOffset(other.utcOffset) + : QSharedData(other), date(other.date), time(other.time), spec(other.spec), utcOffset(other.utcOffset) {} - QAtomicInt ref; QDate date; QTime time; Spec spec;