summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-11-05 05:44:16 +0100
committerStanislaw Halik <sthalik@misaki.pl>2014-11-05 05:44:16 +0100
commit94b1064ca90a77965103462fbaf01b268d6aa595 (patch)
treeac16da46202d8ca45b62465873f23d80e4053fdf
parentfa7a186ca4aa694901a9e305a7155181288accc9 (diff)
fix null filter settings the right way
Previous "fix" caused filter settings not opening at all.
-rw-r--r--facetracknoir/ui.cpp15
1 files 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<typename t>
mem<t> mk_dialog(mem<dylib> lib)
{
- if (lib)
+ if (lib && lib->Dialog)
{
auto dialog = mem<t>(reinterpret_cast<t*>(lib->Dialog()));
dialog->setWindowFlags(Qt::Dialog);
@@ -350,16 +350,17 @@ void MainWindow::showProtocolSettings() {
}
void MainWindow::showFilterSettings() {
- if (libs.pFilter != nullptr)
- {
- auto dialog = mk_dialog<IFilterDialog>(current_filter());
+ auto dialog = mk_dialog<IFilterDialog>(current_filter());
+
- if (dialog)
+ if (dialog)
+ {
+ pFilterDialog = dialog;
+ if (libs.pFilter != nullptr)
{
- pFilterDialog = dialog;
dialog->register_filter(libs.pFilter.get());
- dialog->show();
}
+ dialog->show();
}
}