Cleanup reference counting in QDateTimePrivate class.
authorJedrzej Nowacki <jedrzej.nowacki@nokia.com>
Fri, 10 Jun 2011 08:47:07 +0000 (10:47 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 12 Jul 2011 10:28:12 +0000 (12:28 +0200)
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 <qt_sanity_bot@ovi.com>
Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
src/corelib/tools/qdatetime_p.h

index 8d931dc..c20f212 100644 (file)
 
 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;