]> sigrok.org Git - pulseview.git/commitdiff
Use g_variant_equal() instead of g_variant_compare() to compare enums.
authorMarcus Comstedt <redacted>
Sun, 4 Aug 2013 14:32:37 +0000 (16:32 +0200)
committerMarcus Comstedt <redacted>
Sun, 4 Aug 2013 14:32:37 +0000 (16:32 +0200)
g_variant_compare() doesn't support tuples, and we're only interrested
in equality anyway.

pv/prop/enum.cpp

index ced2f2bb0c79664b98af758a2ecf42b6d711316a..2249b570851fd183aeb943cb857923584902608a 100644 (file)
@@ -56,7 +56,7 @@ QWidget* Enum::get_widget(QWidget *parent)
        for (unsigned int i = 0; i < _values.size(); i++) {
                const pair<GVariant*, QString> &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);
        }