diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2010-03-09 10:06:30 (GMT) |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2010-03-09 10:35:53 (GMT) |
commit | d0794c43f21aab3d1ce926f38c315ba2ac999c41 (patch) | |
tree | 82f5e069b849b111e7fc114c0746d74e7502fd25 | |
parent | 7a52e5948c0305ca41a9b66d591a12d171fd2bae (diff) | |
download | Qt-d0794c43f21aab3d1ce926f38c315ba2ac999c41.zip Qt-d0794c43f21aab3d1ce926f38c315ba2ac999c41.tar.gz Qt-d0794c43f21aab3d1ce926f38c315ba2ac999c41.tar.bz2 |
Cocoa: Native filedialog does not apply filters on app-bundles
The native file dialog (and finder) handles bundles (like .app) like
normal files rather than directories, unless specified otherwise. But
since they are directories at the same time, we skip sending them
through the name filters. This patch makes sure that we are more
consistent on this matter for the cocoa port.
Task-number: QTBUG-834
Reviewed-by: msorvig
-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 67daced..da8cab5 100644 --- a/src/gui/dialogs/qfiledialog_mac.mm +++ b/src/gui/dialogs/qfiledialog_mac.mm @@ -295,10 +295,14 @@ QT_USE_NAMESPACE if (!mQDirFilterEntryList->contains(info.fileName())) return NO; - // Always accept directories regardless of their names: + // Always accept directories regardless of their names (unless it is a bundle): BOOL isDir; - if ([[NSFileManager defaultManager] fileExistsAtPath:filename isDirectory:&isDir] && isDir) - return YES; + if ([[NSFileManager defaultManager] fileExistsAtPath:filename isDirectory:&isDir] && isDir) { + if ([mSavePanel treatsFilePackagesAsDirectories] == NO) { + if ([[NSWorkspace sharedWorkspace] isFilePackageAtPath:filename] == NO) + return YES; + } + } // No filter means accept everything if (mSelectedNameFilter->isEmpty()) |