Cocoa integration - fix outdated path in QCocoaFileDialogHelper
When we set accessory view sometimes (sic!) a delegate's callback fires: -panel:directoryDidChange: with an outdated path (probably because panels are shared?) resetting our current directory; later we open file dialog with a wrong path as result. Change-Id: Iffb02e801c44c5d9a62c2cca3acdf9278eaadb26 Task-number: QTBUG-50140 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>bb10
parent
dce530b64e
commit
2f115fbe0f
|
|
@ -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)]];
|
||||
|
|
|
|||
Loading…
Reference in New Issue