diff --git a/src/plugins/coreplugin/id.cpp b/src/plugins/coreplugin/id.cpp index b269877cf37..7a0e742b7de 100644 --- a/src/plugins/coreplugin/id.cpp +++ b/src/plugins/coreplugin/id.cpp @@ -283,6 +283,12 @@ Id Id::withSuffix(const char *suffix) const return Id(ba.constData()); } +Id Id::withSuffix(const QString &suffix) const +{ + const QByteArray ba = name() + suffix.toUtf8(); + return Id(ba.constData()); +} + /*! Constructs a derived id. diff --git a/src/plugins/coreplugin/id.h b/src/plugins/coreplugin/id.h index 00f67b6012f..1f8ae83bc71 100644 --- a/src/plugins/coreplugin/id.h +++ b/src/plugins/coreplugin/id.h @@ -50,8 +50,9 @@ public: explicit Id(const QByteArray &name); Id withSuffix(int suffix) const; - Id withSuffix(const char *name) const; - Id withPrefix(const char *name) const; + Id withSuffix(const char *suffix) const; + Id withSuffix(const QString &suffix) const; + Id withPrefix(const char *prefix) const; QByteArray name() const; QString toString() const; // Avoid.