summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs/qfiledialog.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-03-15 14:27:00 +0100
committerLars Knoll <lars.knoll@qt.io>2020-04-01 10:29:26 +0200
commit70beac08afaec0ef0c4ef2e72ebfc007acba7d56 (patch)
treebdb53e3693e023ceae2658190b03162412bf66f8 /src/widgets/dialogs/qfiledialog.cpp
parent66f06a930da0114f62a5470e778182c50117ad27 (diff)
Remove all QRegExp dependencies from widgets
QRegExp is deprecated in Qt6 and will get moved to the Qt 5 compat library. As such we need to remove all API and usages of QRegExp in Qt. Change-Id: I33fb56701d3d7c577f98a304c1d4e6f626fcb397 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/dialogs/qfiledialog.cpp')
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 4d15d8ce85..658d7b562b 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -4352,7 +4352,7 @@ QStringList QFSCompleter::splitPath(const QString &path) const
return QStringList(completionPrefix());
QString pathCopy = QDir::toNativeSeparators(path);
- QString sep = QDir::separator();
+ QChar sep = QDir::separator();
#if defined(Q_OS_WIN)
if (pathCopy == QLatin1String("\\") || pathCopy == QLatin1String("\\\\"))
return QStringList(pathCopy);
@@ -4384,14 +4384,14 @@ QStringList QFSCompleter::splitPath(const QString &path) const
parts.append(QString());
#else
QStringList parts = pathCopy.split(sep);
- if (pathCopy[0] == sep[0]) // read the "/" at the beginning as the split removed it
- parts[0] = sep[0];
+ if (pathCopy[0] == sep) // read the "/" at the beginning as the split removed it
+ parts[0] = sep;
#endif
#if defined(Q_OS_WIN)
bool startsFromRoot = !parts.isEmpty() && parts[0].endsWith(QLatin1Char(':'));
#else
- bool startsFromRoot = pathCopy[0] == sep[0];
+ bool startsFromRoot = pathCopy[0] == sep;
#endif
if (parts.count() == 1 || (parts.count() > 1 && !startsFromRoot)) {
const QFileSystemModel *dirModel;