From 09c6d182a70f25626e12a739a9b7c3db937f47ce Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 27 Apr 2010 09:01:36 +0200 Subject: Cocoa: Native QFileDialog has problems selecting name filter The problem occured if you told the dialog to not show name filter details, then tried to select a filter specifying those details. The patch makes sure that we accept a filter as found in the drop down list if it matches the specified filter with or without details Task-number: QTBUG-8439 Reviewed-by: msorvig --- src/gui/dialogs/qfiledialog_mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/dialogs/qfiledialog_mac.mm b/src/gui/dialogs/qfiledialog_mac.mm index 14a5f15..28acf24 100644 --- a/src/gui/dialogs/qfiledialog_mac.mm +++ b/src/gui/dialogs/qfiledialog_mac.mm @@ -493,7 +493,7 @@ QT_USE_NAMESPACE for (int i=0; isize(); ++i) { QString filter = hideDetails ? [self removeExtensions:filters->at(i)] : filters->at(i); [mPopUpButton addItemWithTitle:QT_PREPEND_NAMESPACE(qt_mac_QStringToNSString)(filter)]; - if (filters->at(i) == selectedFilter) + if (filters->at(i).startsWith(selectedFilter)) [mPopUpButton selectItemAtIndex:i]; } } -- cgit v0.12