diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2020-01-15 19:10:34 +0100 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2020-01-20 20:56:57 +0000 |
commit | 24a25eed1481a7c563431d79e3ad07840c0f7125 (patch) | |
tree | 3eb8a56dac620a31e6af362bf7c03201ea645771 /src/shared | |
parent | ad4040972b9d763b2ceaa7444d18e65dd3da2ee9 (diff) |
Use isEmpty() instead of count() or size()
Change-Id: I0a89d2808c6d041da0dc41ea5aea58e6e8759bb4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/help/bookmarkmanager.cpp | 2 | ||||
-rw-r--r-- | src/shared/proparser/ioutils.cpp | 4 | ||||
-rw-r--r-- | src/shared/proparser/qmakeparser.cpp | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/shared/help/bookmarkmanager.cpp b/src/shared/help/bookmarkmanager.cpp index 7f652b41cf..c067334d4c 100644 --- a/src/shared/help/bookmarkmanager.cpp +++ b/src/shared/help/bookmarkmanager.cpp @@ -702,7 +702,7 @@ void BookmarkManager::itemChanged(QStandardItem *item) if (item->text() != oldText) { if (item->data(Qt::UserRole + 10).toString() != QLatin1String("Folder")) { QList<QStandardItem*>itemList = listModel->findItems(oldText); - if (itemList.count() > 0) + if (!itemList.isEmpty()) itemList.at(0)->setText(item->text()); } } diff --git a/src/shared/proparser/ioutils.cpp b/src/shared/proparser/ioutils.cpp index 302811cac4..74bdedc62c 100644 --- a/src/shared/proparser/ioutils.cpp +++ b/src/shared/proparser/ioutils.cpp @@ -139,7 +139,7 @@ QString IoUtils::shellQuoteUnix(const QString &arg) 0x00, 0x00, 0x00, 0x38, 0x01, 0x00, 0x00, 0x78 }; // 0-32 \'"$`<>|;&(){}*?#!~[] - if (!arg.length()) + if (arg.isEmpty()) return QString::fromLatin1("''"); QString ret(arg); @@ -167,7 +167,7 @@ QString IoUtils::shellQuoteWin(const QString &arg) 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x10 }; // &()<>^| - if (!arg.length()) + if (arg.isEmpty()) return QString::fromLatin1("\"\""); QString ret(arg); diff --git a/src/shared/proparser/qmakeparser.cpp b/src/shared/proparser/qmakeparser.cpp index 8d6ef622fd..1d72f72f16 100644 --- a/src/shared/proparser/qmakeparser.cpp +++ b/src/shared/proparser/qmakeparser.cpp @@ -885,7 +885,7 @@ void QMakeParser::read(ProFile *pro, const QStringRef &in, int line, SubGrammar flushScopes(tokPtr); if (m_blockstack.size() > 1 || m_blockstack.top().braceLevel) parseError(fL1S("Missing closing brace(s).")); - while (m_blockstack.size()) + while (!m_blockstack.isEmpty()) leaveScope(tokPtr); tokBuff.resize(tokPtr - (ushort *)tokBuff.constData()); // Reserved capacity stays *pro->itemsRef() = tokBuff; |