From be67b7503551e75dab9a1f84cae43bfb28f66477 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 20 Feb 2018 14:32:07 +0100 Subject: [PATCH] GUI: early return --- gui/resultsview.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/gui/resultsview.cpp b/gui/resultsview.cpp index cdc9b957e..8cb183c01 100644 --- a/gui/resultsview.cpp +++ b/gui/resultsview.cpp @@ -461,14 +461,15 @@ void ResultsView::logCopyComplete() void ResultsView::on_mListLog_customContextMenuRequested(const QPoint &pos) { - if (mUI.mListLog->count() > 0) { - QPoint globalPos = mUI.mListLog->mapToGlobal(pos); + if (mUI.mListLog->count() <= 0) + return; - QMenu contextMenu; - contextMenu.addAction(tr("Clear Log"), this, SLOT(logClear())); - contextMenu.addAction(tr("Copy this Log entry"), this, SLOT(logCopyEntry())); - contextMenu.addAction(tr("Copy complete Log"), this, SLOT(logCopyComplete())); + const QPoint globalPos = mUI.mListLog->mapToGlobal(pos); - contextMenu.exec(globalPos); - } + QMenu contextMenu; + contextMenu.addAction(tr("Clear Log"), this, SLOT(logClear())); + contextMenu.addAction(tr("Copy this Log entry"), this, SLOT(logCopyEntry())); + contextMenu.addAction(tr("Copy complete Log"), this, SLOT(logCopyComplete())); + + contextMenu.exec(globalPos); }