summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2012-04-30 14:26:47 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-09 13:42:03 +0200
commitab947649eb984b006a856d41476e615dc901bcf7 (patch)
tree9edee6b47b64ae8c89941c0d01db982973af86d3 /src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
parent9f2f7a8f7270411677f2074fdf635f8b4b94d325 (diff)
QPA: Cleanup native dialog modal execution
Remove the _q_platformRunNativeAppModalPanel() function, together with the launchNativeAppModalPanel() signal and emitLaunchNativeAppModalPanel() slot, which were previously used to run the modal loop inside the QDialog::exec() loop. This trick isn't necessary anymore, so remove the mechanism and code related to it. Rename QPlatformDialogHelper::platformNativeDialogModalHelp() to exec_sys(). This function is now responsible for both showing the native dialog and running the modal loop. QDialog:exec() now calls this function if a native dialog is in use (it does not call QEventLoop::exec() anymore). The dialogResultCode_sys() function was unused, so it has also been removed. This commit also removes some unused private slots that were left over from the port to QPA. Note that the comments in the Cocoa plugin are still valid and relevant, but this commit does not fix the scenarios mentioned. This will be done in a future commit. The Windows plugin needs minor changes. The QueuedConnections to accept() and reject() cause the deliver to come too late, resulting in crashes, hence the change to AutoConnection (which ends up being a DirectConnection). Change-Id: Ifc90325c945ca78737e60bf331929f03ecc52e0a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsdialoghelpers.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowsdialoghelpers.cpp38
1 files changed, 8 insertions, 30 deletions
diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
index 7cd857e3a4..e2c3b6a059 100644
--- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
+++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
@@ -519,29 +519,12 @@ void QWindowsDialogHelperBase<BaseClass>::hide_sys()
}
template <class BaseClass>
-void QWindowsDialogHelperBase<BaseClass>::platformNativeDialogModalHelp()
+void QWindowsDialogHelperBase<BaseClass>::exec_sys()
{
if (QWindowsContext::verboseDialogs)
qDebug("%s" , __FUNCTION__);
- if (QWindowsNativeDialogBase *nd =nativeDialog())
- nd->metaObject()->invokeMethod(this,
- "emitLaunchNativeAppModalPanel",
- Qt::QueuedConnection);
-}
-
-template <class BaseClass>
-void QWindowsDialogHelperBase<BaseClass>::_q_platformRunNativeAppModalPanel()
-{
- if (QWindowsNativeDialogBase *nd =nativeDialog())
- nd->exec(m_ownerWindow);
-}
-
-template <class BaseClass>
-QPlatformDialogHelper::DialogCode QWindowsDialogHelperBase<BaseClass>::dialogResultCode_sys()
-{
- if (QWindowsNativeDialogBase *nd =nativeDialog())
- return nd->result();
- return QPlatformDialogHelper::Rejected;
+ if (QWindowsNativeDialogBase *nd = nativeDialog())
+ nd->exec(m_ownerWindow);
}
static inline bool snapToDefaultButtonHint()
@@ -1135,19 +1118,14 @@ QWindowsNativeDialogBase *QWindowsFileDialogHelper::createNativeDialog()
QWindowsNativeFileDialogBase *result = QWindowsNativeFileDialogBase::create(options()->acceptMode());
if (!result)
return 0;
- QObject::connect(result, SIGNAL(accepted()), this, SIGNAL(accept()),
- Qt::QueuedConnection);
- QObject::connect(result, SIGNAL(rejected()), this, SIGNAL(reject()),
- Qt::QueuedConnection);
+ QObject::connect(result, SIGNAL(accepted()), this, SIGNAL(accept()));
+ QObject::connect(result, SIGNAL(rejected()), this, SIGNAL(reject()));
QObject::connect(result, SIGNAL(directoryEntered(QString)),
- this, SIGNAL(directoryEntered(QString)),
- Qt::QueuedConnection);
+ this, SIGNAL(directoryEntered(QString)));
QObject::connect(result, SIGNAL(currentChanged(QString)),
- this, SIGNAL(currentChanged(QString)),
- Qt::QueuedConnection);
+ this, SIGNAL(currentChanged(QString)));
QObject::connect(result, SIGNAL(filterSelected(QString)),
- this, SIGNAL(filterSelected(QString)),
- Qt::QueuedConnection);
+ this, SIGNAL(filterSelected(QString)));
// Apply settings.
const QSharedPointer<QFileDialogOptions> &opts = options();