Refactor QmuTranslation to not allocate memory.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2018-03-15 08:51:47 +02:00
parent 7a62022f88
commit b547adf344
2 changed files with 5 additions and 5 deletions

View File

@ -30,8 +30,8 @@ namespace qmu
{ {
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QmuTranslation QmuTranslation::translate(const QString &context, const QString &sourceText, QmuTranslation QmuTranslation::translate(const char *context, const char *sourceText,
const QString &disambiguation, int n) const char *disambiguation, int n)
{ {
if (n < 0) if (n < 0)
{ {

View File

@ -54,13 +54,13 @@ class QMUPARSERSHARED_EXPORT QmuTranslation
public: public:
QmuTranslation(); QmuTranslation();
~QmuTranslation(){} ~QmuTranslation(){}
QmuTranslation(const QString &context, const QString &sourceText, const QString &disambiguation = nullptr, QmuTranslation(const QString &context, const QString &sourceText, const QString &disambiguation = QString(),
int n = -1); int n = -1);
QmuTranslation &operator=(const QmuTranslation &tr); QmuTranslation &operator=(const QmuTranslation &tr);
QmuTranslation(const QmuTranslation &tr); QmuTranslation(const QmuTranslation &tr);
QString translate(const QString &locale) const; QString translate(const QString &locale) const;
static QmuTranslation translate(const QString &context, const QString &sourceText, static QmuTranslation translate(const char * context, const char * sourceText,
const QString &disambiguation = nullptr, int n = -1); const char * disambiguation = nullptr, int n = -1);
QString getMcontext() const; QString getMcontext() const;
QString getMsourceText() const; QString getMsourceText() const;
QString getMdisambiguation() const; QString getMdisambiguation() const;