summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRolf Eike Beer <eb@emlix.com>2016-10-11 11:20:43 (GMT)
committerRolf Eike Beer <kde@opensource.sf-tec.de>2016-10-11 16:16:46 (GMT)
commit4349d04c305e81798eaeaa90a25c16cd9e7c90d0 (patch)
tree288d627531d28cd10538bce1798fedd1f707504b
parent0499dca3914633d1ece028a187a1c8fa22d9422d (diff)
use isEmpty() instead of comparing count() to 0
-rw-r--r--core/KGpgExpandableNode.cpp6
-rw-r--r--keytreeview.cpp2
-rw-r--r--kgpg.cpp2
3 files changed, 5 insertions, 5 deletions
diff --git a/core/KGpgExpandableNode.cpp b/core/KGpgExpandableNode.cpp
index 8bfee5d..ce9a6c8 100644
--- a/core/KGpgExpandableNode.cpp
+++ b/core/KGpgExpandableNode.cpp
@@ -44,7 +44,7 @@ KGpgExpandableNode::getChild(const int index) const
int
KGpgExpandableNode::getChildCount()
{
- if (children.count() == 0)
+ if (children.isEmpty())
readChildren();
return children.count();
@@ -53,13 +53,13 @@ KGpgExpandableNode::getChildCount()
bool
KGpgExpandableNode::hasChildren() const
{
- return (children.count() != 0);
+ return !children.isEmpty();
}
bool
KGpgExpandableNode::wasExpanded() const
{
- return (children.count() != 0);
+ return !children.isEmpty();
}
const
diff --git a/keytreeview.cpp b/keytreeview.cpp
index c9ac276..baf5822 100644
--- a/keytreeview.cpp
+++ b/keytreeview.cpp
@@ -53,7 +53,7 @@ KeyTreeView::selectedNodes(bool *psame, KgpgCore::KgpgItemType *pt) const
KgpgItemType tp = 0;
bool sametype = true;
- if (selidx.count() == 0) {
+ if (selidx.isEmpty()) {
if (pt != Q_NULLPTR)
*pt = tp;
if (psame != Q_NULLPTR)
diff --git a/kgpg.cpp b/kgpg.cpp
index ae24f9b..1a33f65 100644
--- a/kgpg.cpp
+++ b/kgpg.cpp
@@ -102,7 +102,7 @@ int KGpgApp::newInstance(QCommandLineParser& parser)
}
// parsing of command line args
- if (parser.isSet("k") || (!KGpgSettings::showSystray() && (parser.positionalArguments().count() == 0) && !parser.isSet("d"))) {
+ if (parser.isSet("k") || (!KGpgSettings::showSystray() && parser.positionalArguments().isEmpty() && !parser.isSet("d"))) {
s_keyManager->show();
KWindowSystem::setOnDesktop(s_keyManager->winId(), KWindowSystem::currentDesktop()); //set on the current desktop
KWindowSystem::unminimizeWindow(s_keyManager->winId()); //de-iconify window