summaryrefslogtreecommitdiff
path: root/src/plugins/bineditor
diff options
context:
space:
mode:
authorAlessandro Portale <alessandro.portale@qt.io>2020-01-15 19:10:34 +0100
committerAlessandro Portale <alessandro.portale@qt.io>2020-01-20 20:56:57 +0000
commit24a25eed1481a7c563431d79e3ad07840c0f7125 (patch)
tree3eb8a56dac620a31e6af362bf7c03201ea645771 /src/plugins/bineditor
parentad4040972b9d763b2ceaa7444d18e65dd3da2ee9 (diff)
downloadqt-creator-24a25eed1481a7c563431d79e3ad07840c0f7125.tar.gz
Use isEmpty() instead of count() or size()
Change-Id: I0a89d2808c6d041da0dc41ea5aea58e6e8759bb4 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/bineditor')
-rw-r--r--src/plugins/bineditor/bineditorwidget.cpp4
-rw-r--r--src/plugins/bineditor/bineditorwidget.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/bineditor/bineditorwidget.cpp b/src/plugins/bineditor/bineditorwidget.cpp
index 9cf0a06c4d..ab8f6d0ba4 100644
--- a/src/plugins/bineditor/bineditorwidget.cpp
+++ b/src/plugins/bineditor/bineditorwidget.cpp
@@ -1556,7 +1556,7 @@ void BinEditorWidget::undo()
setCursorPosition(cmd.position);
if (emitModificationChanged)
emit modificationChanged(m_undoStack.size() != m_unmodifiedState);
- if (!m_undoStack.size())
+ if (m_undoStack.isEmpty())
emit undoAvailable(false);
if (m_redoStack.size() == 1)
emit redoAvailable(true);
@@ -1577,7 +1577,7 @@ void BinEditorWidget::redo()
emit modificationChanged(m_undoStack.size() != m_unmodifiedState);
if (m_undoStack.size() == 1)
emit undoAvailable(true);
- if (!m_redoStack.size())
+ if (m_redoStack.isEmpty())
emit redoAvailable(false);
}
diff --git a/src/plugins/bineditor/bineditorwidget.h b/src/plugins/bineditor/bineditorwidget.h
index 50c369caf0..0bd217ff66 100644
--- a/src/plugins/bineditor/bineditorwidget.h
+++ b/src/plugins/bineditor/bineditorwidget.h
@@ -113,8 +113,8 @@ public:
bool event(QEvent*) override;
- bool isUndoAvailable() const { return m_undoStack.size(); }
- bool isRedoAvailable() const { return m_redoStack.size(); }
+ bool isUndoAvailable() const { return !m_undoStack.isEmpty(); }
+ bool isRedoAvailable() const { return !m_redoStack.isEmpty(); }
QString addressString(quint64 address);