summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qdatetime.cpp5
-rw-r--r--src/corelib/tools/qdatetime.h4
-rw-r--r--src/corelib/tools/qdatetime_p.h4
3 files changed, 6 insertions, 7 deletions
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index 8b9d202..ecb0bcb 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -2231,9 +2231,8 @@ QDateTime::QDateTime(const QDate &date, const QTime &time, Qt::TimeSpec spec)
*/
QDateTime::QDateTime(const QDateTime &other)
- : d(other.d.data())
+ : d(other.d)
{
- d->ref.ref();
}
/*!
@@ -2250,7 +2249,7 @@ QDateTime::~QDateTime()
QDateTime &QDateTime::operator=(const QDateTime &other)
{
- d.assign(other.d.data());
+ d = other.d;
return *this;
}
diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h
index 84d3e83..988d1a2 100644
--- a/src/corelib/tools/qdatetime.h
+++ b/src/corelib/tools/qdatetime.h
@@ -44,7 +44,7 @@
#include <QtCore/qstring.h>
#include <QtCore/qnamespace.h>
-#include <QtCore/qscopedpointer.h>
+#include <QtCore/qsharedpointer.h>
QT_BEGIN_HEADER
@@ -285,7 +285,7 @@ public:
private:
friend class QDateTimePrivate;
void detach();
- QScopedSharedPointer<QDateTimePrivate> d;
+ QExplicitlySharedDataPointer<QDateTimePrivate> d;
#ifndef QT_NO_DATASTREAM
friend Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QDateTime &);
diff --git a/src/corelib/tools/qdatetime_p.h b/src/corelib/tools/qdatetime_p.h
index 0284ed1..227e4fb 100644
--- a/src/corelib/tools/qdatetime_p.h
+++ b/src/corelib/tools/qdatetime_p.h
@@ -81,9 +81,9 @@ class QDateTimePrivate
public:
enum Spec { LocalUnknown = -1, LocalStandard = 0, LocalDST = 1, UTC = 2, OffsetFromUTC = 3};
- QDateTimePrivate() : ref(1), spec(LocalUnknown), utcOffset(0) {}
+ QDateTimePrivate() : spec(LocalUnknown), utcOffset(0) {}
QDateTimePrivate(const QDateTimePrivate &other)
- : ref(1), date(other.date), time(other.time), spec(other.spec), utcOffset(other.utcOffset)
+ : date(other.date), time(other.time), spec(other.spec), utcOffset(other.utcOffset)
{}
QAtomicInt ref;