forked from qt-creator/qt-creator
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:
@@ -251,6 +251,23 @@ Id Id::withSuffix(int suffix) const
|
||||
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
|
||||
*/
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user