Add const char overload for Id::withSuffix

Otherwise `withSuffix('.')` adds `46` to the Id.

Amends 87280f25ce

Fixes: QTCREATORBUG-31325
Change-Id: I95b85220e319812886f4b648286e76f48f43a49b
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Eike Ziller
2024-07-29 11:46:05 +02:00
parent a26ed2e12e
commit b463c7e049
2 changed files with 19 additions and 0 deletions

View File

@@ -251,6 +251,23 @@ Id Id::withSuffix(int suffix) const
return Id(theId(ba.data(), ba.size())); return Id(theId(ba.data(), ba.size()));
} }
/*!
\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 \overload
*/ */

View File

@@ -28,6 +28,8 @@ public:
static Id generate(); static Id generate();
Id withSuffix(int suffix) const; 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 char *suffix) const;
Id withSuffix(const QStringView suffix) const; Id withSuffix(const QStringView suffix) const;
Id withPrefix(const char *prefix) const; Id withPrefix(const char *prefix) const;