aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/python/pythonutils.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2025-01-09 11:58:40 +0100
committerhjk <hjk@qt.io>2025-01-10 13:05:29 +0000
commit2d9d6aa315976dc8937381e453f57263950d8841 (patch)
tree7ccb860763e95ad24272b158ead690afb79e9c3b /src/plugins/python/pythonutils.cpp
parent0986822d44c80ee1fc8fef0289a05ccc2d4d3668 (diff)
Utils: Rename FilePath::toString() into toUrlishString()
toString() is almost always the wrong conversion, but unfortunately too easy to find and often even working at least for local setup. This here raises the bar as the non-availability of the "obvious" toString() hopefully helps people to think about the semantics of the needed conversion and choose the right toXXX() function. The chosen new name is intentional ugly to reduce the likelihood that this (still almost always wrong) function is used out of convenience. Change-Id: I57f1618dd95ef2629d7d978688d130275e096c0f Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/python/pythonutils.cpp')
-rw-r--r--src/plugins/python/pythonutils.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/python/pythonutils.cpp b/src/plugins/python/pythonutils.cpp
index efcfc4940a5..b2648fc7306 100644
--- a/src/plugins/python/pythonutils.cpp
+++ b/src/plugins/python/pythonutils.cpp
@@ -97,7 +97,7 @@ static QStringList replImportArgs(const FilePath &pythonFile, ReplType type)
using MimeTypes = QList<MimeType>;
const MimeTypes mimeTypes = pythonFile.isEmpty() || type == ReplType::Unmodified
? MimeTypes()
- : mimeTypesForFileName(pythonFile.toString());
+ : mimeTypesForFileName(pythonFile.toUrlishString());
const bool isPython = Utils::anyOf(mimeTypes, [](const MimeType &mt) {
return mt.inherits(Constants::C_PY_MIMETYPE) || mt.inherits(Constants::C_PY3_MIMETYPE);
});