summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qcollator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qcollator.cpp')
-rw-r--r--src/corelib/tools/qcollator.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/corelib/tools/qcollator.cpp b/src/corelib/tools/qcollator.cpp
index a198208966..1cf223aae6 100644
--- a/src/corelib/tools/qcollator.cpp
+++ b/src/corelib/tools/qcollator.cpp
@@ -77,9 +77,8 @@ QT_BEGIN_NAMESPACE
\sa setLocale()
*/
QCollator::QCollator(const QLocale &locale)
- : d(new QCollatorPrivate)
+ : d(new QCollatorPrivate(locale))
{
- d->locale = locale;
d->init();
}
@@ -158,8 +157,7 @@ QCollator &QCollator::operator=(const QCollator &other)
void QCollator::detach()
{
if (d->ref.load() != 1) {
- QCollatorPrivate *x = new QCollatorPrivate;
- x->locale = d->locale;
+ QCollatorPrivate *x = new QCollatorPrivate(d->locale);
if (!d->ref.deref())
delete d;
d = x;