summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-02-15 08:09:50 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2016-02-15 08:09:50 +0100
commit80bf4bfe3df425962192118d4357acc144f6aef8 (patch)
tree79e4b6a00d6bf68be62fe157878f38dcd782a475 /src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
parentac8a3b948da1980bc59bae3fc76d20b5b45662a0 (diff)
parent8c2b4266002736da499d169a0da187e5cdc5381a (diff)
Merge remote-tracking branch 'origin/5.6.0' into 5.6
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
index 9dc013ba4d..4c1b190b9c 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
@@ -126,7 +126,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSOpenSavePanelDelegate);
if ([mSavePanel respondsToSelector:@selector(setLevel:)])
[mSavePanel setLevel:NSModalPanelWindowLevel];
- [mSavePanel setDelegate:self];
+
mReturnCode = -1;
mHelper = helper;
mNameFilterDropDownList = new QStringList(mOptions->nameFilters());
@@ -147,7 +147,10 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSOpenSavePanelDelegate);
[self createTextField];
[self createAccessory];
[mSavePanel setAccessoryView:mNameFilterDropDownList->size() > 1 ? mAccessoryView : nil];
-
+ // -setAccessoryView: can result in -panel:directoryDidChange:
+ // resetting our mCurrentDir, set the delegate
+ // here to make sure it gets the correct value.
+ [mSavePanel setDelegate:self];
if (mOptions->isLabelExplicitlySet(QFileDialogOptions::Accept))
[mSavePanel setPrompt:[self strip:options->labelText(QFileDialogOptions::Accept)]];