From: Marcus Comstedt Date: Sun, 4 Aug 2013 14:32:37 +0000 (+0200) Subject: Use g_variant_equal() instead of g_variant_compare() to compare enums. X-Git-Tag: pulseview-0.2.0~331 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=7a2b7394beb87938121b48f81422873002d74155;p=pulseview.git Use g_variant_equal() instead of g_variant_compare() to compare enums. g_variant_compare() doesn't support tuples, and we're only interrested in equality anyway. --- diff --git a/pv/prop/enum.cpp b/pv/prop/enum.cpp index ced2f2bb..2249b570 100644 --- a/pv/prop/enum.cpp +++ b/pv/prop/enum.cpp @@ -56,7 +56,7 @@ QWidget* Enum::get_widget(QWidget *parent) for (unsigned int i = 0; i < _values.size(); i++) { const pair &v = _values[i]; _selector->addItem(v.second, qVariantFromValue((void*)v.first)); - if (value && g_variant_compare(v.first, value) == 0) + if (value && g_variant_equal(v.first, value)) _selector->setCurrentIndex(i); }