summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2022-10-15 17:37:55 +0200
committerAhmad Samir <a.samirh78@gmail.com>2022-10-28 13:42:09 +0200
commitacad1711a6cd98602d06740d7de9b9602eb571c4 (patch)
tree390f5686bee5abf80520622cb97a1df4e06d31f6 /src/widgets/dialogs
parent50b8f2201285eea9d25178c1879cb2fea484b6bc (diff)
QFileDialog: use QString::remove() instead of mid()
Minor, less allocations. Change-Id: I73c188b0030248c6d038fab3dfb949442083d33d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/widgets/dialogs')
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 694c035c26..6974edcaec 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -4157,12 +4157,12 @@ QString QFSCompleter::pathFromIndex(const QModelIndex &index) const
if (!currentLocation.isEmpty() && path.startsWith(currentLocation)) {
#if defined(Q_OS_UNIX)
if (currentLocation == QDir::separator())
- return path.mid(currentLocation.size());
+ return path.remove(0, currentLocation.size());
#endif
if (currentLocation.endsWith(u'/'))
- return path.mid(currentLocation.size());
+ return path.remove(0, currentLocation.size());
else
- return path.mid(currentLocation.size()+1);
+ return path.remove(0, currentLocation.size()+1);
}
return index.data(QFileSystemModel::FilePathRole).toString();
}