summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2009-11-02 14:46:53 (GMT)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2009-11-03 07:53:48 (GMT)
commit02b16c259cf268903823304e02d308cbbd043194 (patch)
tree6f05bba0903cd1de471b6ee7dc65ac02525191a3 /src/gui
parentf1132e60e0759d8be043a2c4312915b3103004ff (diff)
downloadQt-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/gui')
-rw-r--r--src/gui/dialogs/qfiledialog_mac.mm10
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