From 94b1064ca90a77965103462fbaf01b268d6aa595 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 5 Nov 2014 05:44:16 +0100 Subject: fix null filter settings the right way Previous "fix" caused filter settings not opening at all. --- facetracknoir/ui.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/facetracknoir/ui.cpp b/facetracknoir/ui.cpp index 4d5935c6..f8b6e120 100644 --- a/facetracknoir/ui.cpp +++ b/facetracknoir/ui.cpp @@ -318,7 +318,7 @@ void MainWindow::showHeadPose() template mem mk_dialog(mem lib) { - if (lib) + if (lib && lib->Dialog) { auto dialog = mem(reinterpret_cast(lib->Dialog())); dialog->setWindowFlags(Qt::Dialog); @@ -350,16 +350,17 @@ void MainWindow::showProtocolSettings() { } void MainWindow::showFilterSettings() { - if (libs.pFilter != nullptr) - { - auto dialog = mk_dialog(current_filter()); + auto dialog = mk_dialog(current_filter()); + - if (dialog) + if (dialog) + { + pFilterDialog = dialog; + if (libs.pFilter != nullptr) { - pFilterDialog = dialog; dialog->register_filter(libs.pFilter.get()); - dialog->show(); } + dialog->show(); } } -- cgit v1.2.3