Ref T77, prefix for getDbKeyAsStringInParentheses

This commit is contained in:
Klaus Basan
2017-05-08 02:57:02 +02:00
parent ba85e3851b
commit afbb87298f
7 changed files with 11 additions and 11 deletions

View File

@@ -25,10 +25,10 @@ namespace BlackMisc
return QString::number(this->m_dbKey);
}
QString IDatastoreObjectWithIntegerKey::getDbKeyAsStringInParentheses() const
QString IDatastoreObjectWithIntegerKey::getDbKeyAsStringInParentheses(const QString &prefix) const
{
if (this->m_dbKey < 0) { return ""; }
return "(" + QString::number(this->m_dbKey) + ")";
return prefix + "(" + QString::number(this->m_dbKey) + ")";
}
void IDatastoreObjectWithIntegerKey::setDbKey(const QString &key)

View File

@@ -62,7 +62,7 @@ namespace BlackMisc
QJsonValue getDbKeyAsJsonValue() const;
//! Db ley in parentheses, e.g. "(3)"
QString getDbKeyAsStringInParentheses() const;
QString getDbKeyAsStringInParentheses(const QString &prefix = {}) const;
//! Set the DB key
void setDbKey(int key) { m_dbKey = key; }