Skip to content
Snippets Groups Projects
Commit 2330fb48 authored by hjk's avatar hjk
Browse files

Core: Add a convenience .withSuffix(QString) method


Change-Id: Ia6a1802376442d3e3ccdce2b0a061c71edafa8c9
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent b76992c3
No related branches found
No related tags found
No related merge requests found
...@@ -283,6 +283,12 @@ Id Id::withSuffix(const char *suffix) const ...@@ -283,6 +283,12 @@ Id Id::withSuffix(const char *suffix) const
return Id(ba.constData()); 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. Constructs a derived id.
......
...@@ -50,8 +50,9 @@ public: ...@@ -50,8 +50,9 @@ public:
explicit Id(const QByteArray &name); explicit Id(const QByteArray &name);
Id withSuffix(int suffix) const; Id withSuffix(int suffix) const;
Id withSuffix(const char *name) const; Id withSuffix(const char *suffix) const;
Id withPrefix(const char *name) const; Id withSuffix(const QString &suffix) const;
Id withPrefix(const char *prefix) const;
QByteArray name() const; QByteArray name() const;
QString toString() const; // Avoid. QString toString() const; // Avoid.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment