summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2011-06-30 09:14:32 (GMT)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2011-06-30 09:17:54 (GMT)
commitcee1f6454a7b52a52795590e2f793c0cd4e15ce1 (patch)
treedb89450c30a51a3ee1d07ccc8d7b69954cbf3f87 /src/gui
parent0a8daa8845325fba9cf2ec973eb6bab8a2853dd5 (diff)
downloadQt-cee1f6454a7b52a52795590e2f793c0cd4e15ce1.zip
Qt-cee1f6454a7b52a52795590e2f793c0cd4e15ce1.tar.gz
Qt-cee1f6454a7b52a52795590e2f793c0cd4e15ce1.tar.bz2
Cocoa: QFileDialog: fix filename filter not applied correctly
From before, the filename filters set on the dialog were matched against the full patch of the filenames shown in the dialog. The correct way is to only match it against the filename. This becomes evident if you set a filter that has no wild cards, e.g "qmake" Rev-By: jbache
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/dialogs/qfiledialog_mac.mm5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/dialogs/qfiledialog_mac.mm b/src/gui/dialogs/qfiledialog_mac.mm
index fb52274..f1d3a4a 100644
--- a/src/gui/dialogs/qfiledialog_mac.mm
+++ b/src/gui/dialogs/qfiledialog_mac.mm
@@ -305,12 +305,13 @@ QT_USE_NAMESPACE
QString qtFileName = QT_PREPEND_NAMESPACE(qt_mac_NSStringToQString)(filename);
QFileInfo info(qtFileName.normalized(QT_PREPEND_NAMESPACE(QString::NormalizationForm_C)));
QString path = info.absolutePath();
+ QString name = info.fileName();
if (path != *mLastFilterCheckPath){
*mLastFilterCheckPath = path;
*mQDirFilterEntryList = info.dir().entryList(*mQDirFilter);
}
// Check if the QDir filter accepts the file:
- if (!mQDirFilterEntryList->contains(info.fileName()))
+ if (!mQDirFilterEntryList->contains(name))
return NO;
// No filter means accept everything
@@ -318,7 +319,7 @@ QT_USE_NAMESPACE
return YES;
// Check if the current file name filter accepts the file:
for (int i=0; i<mSelectedNameFilter->size(); ++i) {
- if (QDir::match(mSelectedNameFilter->at(i), qtFileName))
+ if (QDir::match(mSelectedNameFilter->at(i), name))
return YES;
}
return NO;