From 2448b80b5fa9c30dc60f970be76309a428769192 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 26 Oct 2015 17:48:15 -0200 Subject: [PATCH] Simplify Code Since it's just a state-toogler, use the return value of the method to set the values directly. Signed-off-by: Tomaz Canabrava --- src/ui/MainWindow.cc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc index b1500252f..2e9da5c02 100644 --- a/src/ui/MainWindow.cc +++ b/src/ui/MainWindow.cc @@ -238,16 +238,8 @@ MainWindow::MainWindow() } // Make sure the proper fullscreen/normal menu item is checked properly. - if (isFullScreen()) - { - _ui.actionFullscreen->setChecked(true); - _ui.actionNormal->setChecked(false); - } - else - { - _ui.actionFullscreen->setChecked(false); - _ui.actionNormal->setChecked(true); - } + _ui.actionFullscreen->setChecked(isFullScreen()); + _ui.actionNormal->setChecked(!isFullScreen()); // And that they will stay checked properly after user input connect(_ui.actionFullscreen, &QAction::triggered, this, &MainWindow::fullScreenActionItemCallback); -- 2.22.0