]> sigrok.org Git - pulseview.git/blobdiff - pv/prop/enum.cpp
pv::prop::Enum: Do not create a widget if the initial value could not be retrieved
[pulseview.git] / pv / prop / enum.cpp
index 412a31b0827854d01d103d5f110325b7717faaad..9044c6bae9d3c6335589c26e7be65835186a7b81 100644 (file)
@@ -24,8 +24,8 @@
 
 #include "enum.h"
 
-using namespace boost;
-using namespace std;
+using std::pair;
+using std::vector;
 
 namespace pv {
 namespace prop {
@@ -51,6 +51,8 @@ QWidget* Enum::get_widget(QWidget *parent, bool auto_commit)
                return _selector;
 
        GVariant *const value = _getter ? _getter() : NULL;
+       if (!value)
+               return NULL;
 
        _selector = new QComboBox(parent);
        for (unsigned int i = 0; i < _values.size(); i++) {