diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-11-02 14:46:53 (GMT) |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-11-03 07:53:48 (GMT) |
commit | 02b16c259cf268903823304e02d308cbbd043194 (patch) | |
tree | 6f05bba0903cd1de471b6ee7dc65ac02525191a3 /src | |
parent | f1132e60e0759d8be043a2c4312915b3103004ff (diff) | |
download | Qt-02b16c259cf268903823304e02d308cbbd043194.zip Qt-02b16c259cf268903823304e02d308cbbd043194.tar.gz Qt-02b16c259cf268903823304e02d308cbbd043194.tar.bz2 |
Cocoa: fix double emit bug from file dialog
For some reason, Cocoa tells us twize whenever a selection
change occurs in the native file dialog. This patch inserts
a check that the selection actually changed before emitting
any signals
Rev-By: Prasanth
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/dialogs/qfiledialog_mac.mm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gui/dialogs/qfiledialog_mac.mm b/src/gui/dialogs/qfiledialog_mac.mm index d9bec27..4af5688 100644 --- a/src/gui/dialogs/qfiledialog_mac.mm +++ b/src/gui/dialogs/qfiledialog_mac.mm @@ -399,9 +399,13 @@ QT_USE_NAMESPACE - (void)panelSelectionDidChange:(id)sender { Q_UNUSED(sender); - *mCurrentSelection = QT_PREPEND_NAMESPACE(qt_mac_NSStringToQString([mSavePanel filename])); - if (mPriv) - mPriv->QNSOpenSavePanelDelegate_selectionChanged(*mCurrentSelection); + if (mPriv) { + QString selection = QT_PREPEND_NAMESPACE(qt_mac_NSStringToQString([mSavePanel filename])); + if (selection != mCurrentSelection) { + *mCurrentSelection = selection; + mPriv->QNSOpenSavePanelDelegate_selectionChanged(selection); + } + } } - (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode contextInfo:(void *)contextInfo |