diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-09-09 04:48:03 -0300 |
---|---|---|
committer | Tomaz Canabrava <tcanabrava@kde.org> | 2013-09-09 04:48:03 -0300 |
commit | 6a7256fdd5609b3792b2b0e6a3e85203d0ee8206 (patch) | |
tree | eed5bd5a1ca7cdfe99a426e13a29a5c81087a35f | |
parent | 2e700f2dde6cd43cdb3ff53b56eb5e8699125444 (diff) | |
download | subsurface-6a7256fdd5609b3792b2b0e6a3e85203d0ee8206.tar.gz |
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>
-rw-r--r-- | qt-gui.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-gui.cpp b/qt-gui.cpp index e1587ddfe..eb199f0ab 100644 --- a/qt-gui.cpp +++ b/qt-gui.cpp @@ -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; |