diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2012-05-09 13:55:25 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-10 06:56:20 +0200 |
commit | 5f43422ddf38e48f56b2ef39ee19bec2cb430ac4 (patch) | |
tree | b8be9f5168345b2ff366881e0bc31f6f39fc4d8d /src/widgets/dialogs/qdialog.cpp | |
parent | d223b30c42a9a8d42a8dd35b2d93615e646b4f1e (diff) |
qpa: Remove QPlatformDialogHelper::deleteNativeDialog()
This function isn't really needed. The QDialogPrivate destructor deletes
the platform helper, so the QDialog destructor does not need to do it.
Subclasses of QPlatformDialogHelper are now responsible for deleting any
native resources they create.
The one place in QFileDialog that needs to recreate the native dialog
can simply recreate the helper. QDialogPrivate::deleteNativeDialog() now
becomes QDialogPrivate::deletePlatformHelper(), which resets all state
to allow the platform helper to be recreated.
Change-Id: I58adfe8801e02e63b3cb4a9a3a0b8cb5b3c7b161
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/widgets/dialogs/qdialog.cpp')
-rw-r--r-- | src/widgets/dialogs/qdialog.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp index b0cc35340d..f3e0773eac 100644 --- a/src/widgets/dialogs/qdialog.cpp +++ b/src/widgets/dialogs/qdialog.cpp @@ -123,12 +123,12 @@ QVariant QDialogPrivate::styleHint(QPlatformDialogHelper::StyleHint hint) const return QPlatformDialogHelper::defaultStyleHint(hint); } -void QDialogPrivate::deleteNativeDialog() +void QDialogPrivate::deletePlatformHelper() { - if (QPlatformDialogHelper *helper = platformHelper()) { - helper->deleteNativeDialog(); - nativeDialogInUse = false; - } + delete m_platformHelper; + m_platformHelper = 0; + m_platformHelperCreated = false; + nativeDialogInUse = false; } /*! @@ -335,7 +335,6 @@ QDialog::~QDialog() } QT_CATCH(...) { // we're in the destructor - just swallow the exception } - d->deleteNativeDialog(); } /*! |