From df81a39aa5d10fd12928a1bef7fdf31e0050e439 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 26 Jan 2018 18:39:46 +0100 Subject: Remove unnecessary check for MainWindow instance The error-callback is installed in the MainWindow constructor. Therefore, in the error-callback the existence of the MainWindow instance is guaranteed. Signed-off-by: Berthold Stoeger --- desktop-widgets/mainwindow.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 7fa12c524..3c70f73f4 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -91,9 +91,7 @@ MainWindow *MainWindow::m_Instance = NULL; extern "C" void showErrorFromC() { - MainWindow *mainwindow = MainWindow::instance(); - if (mainwindow) - emit mainwindow->showError(get_error_string()); + emit MainWindow::instance()->showError(get_error_string()); } MainWindow::MainWindow() : QMainWindow(), -- cgit v1.2.3-70-g09d2