Fix QString Usage
Fixes QString Usage. to return a Empty QString, one should
return a QString() and not a QString(""), and to check if
the string is empty, one should check for string.isEmpty()
instead of "string != "" ", because the latter will create
a new QString, then call the != operator, less function calls,
better code.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
parent
2e700f2dde
commit
6a7256fdd5
@ -159,8 +159,8 @@ const QString get_dc_nickname(const char *model, uint32_t deviceid)
|
||||
{
|
||||
const DiveComputerNode *existNode = dcList.getExact(model, deviceid);
|
||||
if (!existNode)
|
||||
return QString("");
|
||||
if (existNode->nickName != "")
|
||||
return QString();
|
||||
else if (!existNode->nickName.isEmpty())
|
||||
return existNode->nickName;
|
||||
else
|
||||
return model;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user