From: Uwe Hermann Date: Fri, 30 Jan 2015 18:39:30 +0000 (+0100) Subject: Fix the build for older glibmm versions. X-Git-Tag: pulseview-0.3.0~238 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=0aff286e72c0fb99e2dfeed565a8f5470b2296f0;p=pulseview.git Fix the build for older glibmm versions. With older glibmm versions the following error occured: pv/toolbars/mainbar.cpp:228:6: error: no match for ‘operator!’ (operand type is ‘Glib::VariantContainerBase’) if (!gvar_dict) { ^ Work around the above issue by using .gobj() and not relying on "Glib::VariantBase::operator BoolExpr() const", which was only added in glibmm 2.36. This fixes bug #548. Tested on a Debian stable system with glibmm 2.32.1 and Boost 1.49. --- diff --git a/pv/toolbars/mainbar.cpp b/pv/toolbars/mainbar.cpp index 4ff82357..adecf6ac 100644 --- a/pv/toolbars/mainbar.cpp +++ b/pv/toolbars/mainbar.cpp @@ -239,7 +239,7 @@ void MainBar::update_sample_rate_selector() } } - if (!gvar_dict) { + if (!gvar_dict.gobj()) { sample_rate_.show_none(); updating_sample_rate_ = false; return; @@ -342,7 +342,7 @@ void MainBar::update_sample_count_selector() try { auto gvar = device->config_list(ConfigKey::LIMIT_SAMPLES); - if (gvar) + if (gvar.gobj()) g_variant_get(gvar.gobj(), "(tt)", &min_sample_count, &max_sample_count); } catch(const sigrok::Error &e) {