1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

refactor(friend): Pass QString by const reference

This commit is contained in:
Diadlo 2017-07-29 21:16:12 +03:00
parent 017653470d
commit 6c85e542a3
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727
2 changed files with 7 additions and 6 deletions

View File

@ -56,8 +56,9 @@ void Friend::loadHistory()
emit loadChatHistory();
}
void Friend::setName(QString name)
void Friend::setName(const QString& _name)
{
QString name = _name;
if (name.isEmpty()) {
name = friendPk.toString();
}
@ -68,7 +69,7 @@ void Friend::setName(QString name)
}
}
void Friend::setAlias(QString alias)
void Friend::setAlias(const QString& alias)
{
if (userAlias != alias) {
userAlias = alias;
@ -76,7 +77,7 @@ void Friend::setAlias(QString alias)
}
}
void Friend::setStatusMessage(QString message)
void Friend::setStatusMessage(const QString& message)
{
if (statusMessage != message) {
statusMessage = message;

View File

@ -39,12 +39,12 @@ public:
void loadHistory();
void setName(QString name);
void setAlias(QString name);
void setName(const QString& name);
void setAlias(const QString& name);
QString getDisplayedName() const;
bool hasAlias() const;
void setStatusMessage(QString message);
void setStatusMessage(const QString& message);
QString getStatusMessage() const;
void setEventFlag(bool f);