diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2018-07-11 18:15:13 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2018-08-13 14:15:22 +0000 |
commit | baf0933415153daaeb9387dd2f6ea5da84bef04f (patch) | |
tree | 6eab03ce91dbdac50e6c0a4e4056b5b9288956b0 /src/corelib/tools/qcollator.cpp | |
parent | 10a88b8149e7699b08871a8a62892ac0f39b54f2 (diff) |
Set dirty in QCollator::detach() rather than calling init()
Each of its callers set dirty after calling detach() in any case, so
the call to init() was going to be duplicated (if the instance ever
got used again for something that benefits from it), and the d-ptr is
freshly created in any case, so can't be carrying any stray gunk from
earlier use, that init() might purge.
Change-Id: Id2485889c8ae4ee531c88562ff63f1a8ac0f4a36
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qcollator.cpp')
-rw-r--r-- | src/corelib/tools/qcollator.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/corelib/tools/qcollator.cpp b/src/corelib/tools/qcollator.cpp index 5155badcf8..2e231003b7 100644 --- a/src/corelib/tools/qcollator.cpp +++ b/src/corelib/tools/qcollator.cpp @@ -165,8 +165,9 @@ void QCollator::detach() if (!d->ref.deref()) delete d; d = x; - d->init(); } + // All callers need this, because about to modify the object: + d->dirty = true; } /*! @@ -179,7 +180,6 @@ void QCollator::setLocale(const QLocale &locale) detach(); d->locale = locale; - d->dirty = true; } /*! @@ -204,7 +204,6 @@ void QCollator::setCaseSensitivity(Qt::CaseSensitivity cs) detach(); d->caseSensitivity = cs; - d->dirty = true; } /*! @@ -242,7 +241,6 @@ void QCollator::setNumericMode(bool on) detach(); d->numericMode = on; - d->dirty = true; } /*! @@ -275,7 +273,6 @@ void QCollator::setIgnorePunctuation(bool on) detach(); d->ignorePunctuation = on; - d->dirty = true; } /*! |