Call QString::normalized when it is constructed via the native API

When a string comes from the native APIs then it may need to be
normalized.

Task-number: QTBUG-14787
Change-Id: I5164e80efcd1d99a50263c72bcf97d7fb31b38f7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This commit is contained in:
Andy Shaw 2013-03-15 14:55:46 +01:00 committed by The Qt Project
parent 3a3e9b74eb
commit ac4474900c

View File

@ -211,7 +211,7 @@ static QString strippedText(QString s)
- (void)closePanel
{
*mCurrentSelection = QT_PREPEND_NAMESPACE(QCFString::toQString)([[mSavePanel URL] path]);
*mCurrentSelection = QT_PREPEND_NAMESPACE(QCFString::toQString)([[mSavePanel URL] path]).normalized(QString::NormalizationForm_C);
if ([mSavePanel respondsToSelector:@selector(close)])
[mSavePanel close];
if ([mSavePanel isSheet])
@ -376,11 +376,11 @@ static QString strippedText(QString s)
QStringList result;
NSArray* array = [mOpenPanel URLs];
for (NSUInteger i=0; i<[array count]; ++i)
result << QCFString::toQString([[array objectAtIndex:i] path]);
result << QCFString::toQString([[array objectAtIndex:i] path]).normalized(QString::NormalizationForm_C);
return result;
} else {
QStringList result;
QString filename = QT_PREPEND_NAMESPACE(QCFString::toQString)([[mSavePanel URL] path]);
QString filename = QT_PREPEND_NAMESPACE(QCFString::toQString)([[mSavePanel URL] path]).normalized(QString::NormalizationForm_C);
result << filename.remove(QLatin1String("___qt_very_unlikely_prefix_"));
return result;
}
@ -586,7 +586,7 @@ QString QCocoaFileDialogHelper::directory() const
{
QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *>(mDelegate);
if (delegate)
return QCFString::toQString([[delegate->mSavePanel directoryURL] path]);
return QCFString::toQString([[delegate->mSavePanel directoryURL] path]).normalized(QString::NormalizationForm_C);
return QString();
}