mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
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
1 changed files with 2 additions and 2 deletions
|
@ -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…
Reference in a new issue