summaryrefslogtreecommitdiff
path: root/src/plugins/projectexplorer/projectmodels.cpp
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2021-06-04 09:13:49 +0200
committerDavid Schulz <david.schulz@qt.io>2021-06-04 09:32:52 +0000
commitaa8d2dc2d1ec7575fe9a8fc1170e97cd7f7c951d (patch)
tree5eab1cc3400481b978b0b883f81a751250e32bb7 /src/plugins/projectexplorer/projectmodels.cpp
parenteafc52cf1e1f01caf3aaeb5869cd9acf7f4ae4b9 (diff)
downloadqt-creator-aa8d2dc2d1ec7575fe9a8fc1170e97cd7f7c951d.tar.gz
Utils: add FilePath::(complete)suffix
The same as FilePath::(complete)baseName avoid some toFileInfo. Change-Id: Id1901ce2a4bef675215a9e020280df1c846df405 Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/projectmodels.cpp')
-rw-r--r--src/plugins/projectexplorer/projectmodels.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp
index 425f53548d..d701a60ca2 100644
--- a/src/plugins/projectexplorer/projectmodels.cpp
+++ b/src/plugins/projectexplorer/projectmodels.cpp
@@ -212,7 +212,7 @@ bool FlatModel::setData(const QModelIndex &index, const QVariant &value, int rol
// The base name of the file was changed. Go look for other files with the same base name
// and offer to rename them as well.
- if (orgFilePath != newFilePath && orgFileInfo.suffix() == newFilePath.toFileInfo().suffix()) {
+ if (orgFilePath != newFilePath && orgFileInfo.suffix() == newFilePath.suffix()) {
const QList<Node *> candidateNodes = ProjectTree::siblingsWithSameBaseName(node);
if (!candidateNodes.isEmpty()) {
const QMessageBox::StandardButton reply = QMessageBox::question(
@@ -225,7 +225,7 @@ bool FlatModel::setData(const QModelIndex &index, const QVariant &value, int rol
for (Node * const n : candidateNodes) {
QString targetFilePath = orgFileInfo.absolutePath() + '/'
+ newFilePath.completeBaseName();
- const QString suffix = n->filePath().toFileInfo().suffix();
+ const QString suffix = n->filePath().suffix();
if (!suffix.isEmpty())
targetFilePath.append('.').append(suffix);
toRename.emplace_back(std::make_tuple(n, n->filePath(),