aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
authorEike Ziller <[email protected]>2024-07-29 11:46:05 +0200
committerEike Ziller <[email protected]>2024-07-29 10:13:25 +0000
commitb463c7e04923f412f21329908f8eed383080a2c5 (patch)
tree2cc61b7d3e3fca089d87e890f72a4ddbf2dc501a /src/libs
parenta26ed2e12e94930948c1dc0fc4315eafb2c7e97d (diff)
Add `const char` overload for Id::withSuffix
Otherwise `withSuffix('.')` adds `46` to the Id. Amends 87280f25ce4ac99306825cdfba2697b735c6349b Fixes: QTCREATORBUG-31325 Change-Id: I95b85220e319812886f4b648286e76f48f43a49b Reviewed-by: hjk <[email protected]>
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/utils/id.cpp17
-rw-r--r--src/libs/utils/id.h2
2 files changed, 19 insertions, 0 deletions
diff --git a/src/libs/utils/id.cpp b/src/libs/utils/id.cpp
index 2f0bdbd4eea..9e170317cff 100644
--- a/src/libs/utils/id.cpp
+++ b/src/libs/utils/id.cpp
@@ -254,6 +254,23 @@ Id Id::withSuffix(int suffix) const
/*!
\overload
*/
+Id Id::withSuffix(qsizetype suffix) const
+{
+ return withSuffix(int(suffix));
+}
+
+/*!
+ \overload
+*/
+Id Id::withSuffix(const char suffix) const
+{
+ const QByteArray ba = name() + suffix;
+ return Id(theId(ba.data(), ba.size()));
+}
+
+/*!
+ \overload
+*/
Id Id::withSuffix(const char *suffix) const
{
diff --git a/src/libs/utils/id.h b/src/libs/utils/id.h
index 49d43746358..e8a150a49fa 100644
--- a/src/libs/utils/id.h
+++ b/src/libs/utils/id.h
@@ -28,6 +28,8 @@ public:
static Id generate();
Id withSuffix(int suffix) const;
+ Id withSuffix(qsizetype suffix) const;
+ Id withSuffix(const char suffix) const;
Id withSuffix(const char *suffix) const;
Id withSuffix(const QStringView suffix) const;
Id withPrefix(const char *prefix) const;