forked from qt-creator/qt-creator
CorePlugin: Compile with QT_NO_CAST_FROM_ASCII.
- Wrap literals in QLatin1String()/QLatin1Char(). - Extract some string constants avoiding repeated QString construction. - Fix repeated invocation of Container.end() in loops. Change-Id: If737735507aaf82e53063adda53f54c46418f42f Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
@@ -682,11 +682,11 @@ QString FileManager::getSaveFileName(const QString &title, const QString &pathIn
|
||||
if (selectedFilter && *selectedFilter != QCoreApplication::translate(
|
||||
"Core", Constants::ALL_FILES_FILTER)) {
|
||||
// Mime database creates filter strings like this: Anything here (*.foo *.bar)
|
||||
QRegExp regExp(".*\\s+\\((.*)\\)$");
|
||||
QRegExp regExp(QLatin1String(".*\\s+\\((.*)\\)$"));
|
||||
const int index = regExp.lastIndexIn(*selectedFilter);
|
||||
bool suffixOk = false;
|
||||
if (index != -1) {
|
||||
const QStringList &suffixes = regExp.cap(1).remove('*').split(' ');
|
||||
const QStringList &suffixes = regExp.cap(1).remove(QLatin1Char('*')).split(QLatin1Char(' '));
|
||||
foreach (const QString &suffix, suffixes)
|
||||
if (fileName.endsWith(suffix)) {
|
||||
suffixOk = true;
|
||||
|
Reference in New Issue
Block a user