macOS: Respect QDir::Hidden for native file dialogs
The default for showsHiddenFiles is NO, so we were not showing hidden files unless the user toggled them via the keyboard shortcut. Change-Id: I796144452cf8f5a6cc46f1ba6747affcd0a35879 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit bc648641209ff598687ae9bcf88cd40d8aaf8847) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
dd4a42e86f
commit
4fa8095ad4
@ -243,8 +243,12 @@ typedef QSharedPointer<QFileDialogOptions> SharedPointerFileDialogOptions;
|
|||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(filter & QDir::Hidden) && fileInfo.isHidden())
|
// We control the visibility of hidden files via the showsHiddenFiles
|
||||||
return NO;
|
// property on the panel, based on QDir::Hidden being set. But the user
|
||||||
|
// can also toggle this via the Command+Shift+. keyboard shortcut,
|
||||||
|
// in which case they have explicitly requested to show hidden files,
|
||||||
|
// and we should enable them even if QDir::Hidden was not set. In
|
||||||
|
// effect, we don't need to filter on QDir::Hidden here.
|
||||||
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
@ -350,6 +354,8 @@ typedef QSharedPointer<QFileDialogOptions> SharedPointerFileDialogOptions;
|
|||||||
if (m_panel.allowedFileTypes.count > 2)
|
if (m_panel.allowedFileTypes.count > 2)
|
||||||
m_panel.extensionHidden = NO;
|
m_panel.extensionHidden = NO;
|
||||||
|
|
||||||
|
m_panel.showsHiddenFiles = m_options->filter().testFlag(QDir::Hidden);
|
||||||
|
|
||||||
if (m_panel.visible)
|
if (m_panel.visible)
|
||||||
[m_panel validateVisibleColumns];
|
[m_panel validateVisibleColumns];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user