From 4f3f73bc3b591ce423d90801e6bbd3febfc049cb Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 19 Mar 2019 09:01:18 +0100 Subject: [PATCH] Utils: Rename one of the FileName::fromString overloads Overloaded functions are ugly to use in algorithms like transform(). Change-Id: Ia4f191e1cd9a21ceb99dec23a8f4fd1ce5f24182 Reviewed-by: Christian Kandeler --- src/libs/utils/fileutils.cpp | 2 +- src/libs/utils/fileutils.h | 2 +- src/plugins/coreplugin/corejsextensions.cpp | 2 +- src/plugins/cpptools/cpptoolsjsextension.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libs/utils/fileutils.cpp b/src/libs/utils/fileutils.cpp index a476cd8d892..411dbf777d9 100644 --- a/src/libs/utils/fileutils.cpp +++ b/src/libs/utils/fileutils.cpp @@ -654,7 +654,7 @@ FileName FileName::fromString(const QString &filename) /// Constructs a FileName from \a fileName. The \a defaultExtension is appended /// to \a filename if that does not have an extension already. /// \a fileName is not checked for validity. -FileName FileName::fromString(const QString &filename, const QString &defaultExtension) +FileName FileName::fromStringWithExtension(const QString &filename, const QString &defaultExtension) { if (filename.isEmpty() || defaultExtension.isEmpty()) return filename; diff --git a/src/libs/utils/fileutils.h b/src/libs/utils/fileutils.h index aa6310c7601..00278a55a19 100644 --- a/src/libs/utils/fileutils.h +++ b/src/libs/utils/fileutils.h @@ -67,7 +67,7 @@ public: explicit FileName(const QFileInfo &info); QFileInfo toFileInfo() const; static FileName fromString(const QString &filename); - static FileName fromString(const QString &filename, const QString &defaultExtension); + static FileName fromStringWithExtension(const QString &filename, const QString &defaultExtension); static FileName fromLatin1(const QByteArray &filename); static FileName fromUserInput(const QString &filename); static FileName fromUtf8(const char *filename, int filenameSize = -1); diff --git a/src/plugins/coreplugin/corejsextensions.cpp b/src/plugins/coreplugin/corejsextensions.cpp index 7398d60a944..02e66016407 100644 --- a/src/plugins/coreplugin/corejsextensions.cpp +++ b/src/plugins/coreplugin/corejsextensions.cpp @@ -118,7 +118,7 @@ QString UtilsJsExtension::preferredSuffix(const QString &mimetype) const QString UtilsJsExtension::fileName(const QString &path, const QString &extension) const { - return Utils::FileName::fromString(path, extension).toString(); + return Utils::FileName::fromStringWithExtension(path, extension).toString(); } QString UtilsJsExtension::mktemp(const QString &pattern) const diff --git a/src/plugins/cpptools/cpptoolsjsextension.cpp b/src/plugins/cpptools/cpptoolsjsextension.cpp index d5efc1db6d6..2d3b7f01ea4 100644 --- a/src/plugins/cpptools/cpptoolsjsextension.cpp +++ b/src/plugins/cpptools/cpptoolsjsextension.cpp @@ -45,7 +45,7 @@ QString CppToolsJsExtension::headerGuard(const QString &in) const QString CppToolsJsExtension::fileName(const QString &path, const QString &extension) const { - QString raw = Utils::FileName::fromString(path, extension).toString(); + QString raw = Utils::FileName::fromStringWithExtension(path, extension).toString(); CppFileSettings settings; settings.fromSettings(Core::ICore::settings()); if (!settings.lowerCaseFiles)