]> sigrok.org Git - pulseview.git/blobdiff - pv/binding/inputoutput.cpp
Build fixes for Qt5 Windows/mingw/MXE support.
[pulseview.git] / pv / binding / inputoutput.cpp
index 42ebf06263539bc582f16a7b1d27e2fbcf128bec..d13ba196e3674ea29b46be4ca3b122bbb38f8f72 100644 (file)
@@ -14,8 +14,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <cassert>
@@ -26,6 +25,7 @@
 
 #include <libsigrokcxx/libsigrokcxx.hpp>
 
+#include <pv/prop/bool.hpp>
 #include <pv/prop/double.hpp>
 #include <pv/prop/enum.hpp>
 #include <pv/prop/int.hpp>
@@ -47,6 +47,7 @@ using Glib::VariantType;
 
 using sigrok::Option;
 
+using pv::prop::Bool;
 using pv::prop::Double;
 using pv::prop::Enum;
 using pv::prop::Int;
@@ -59,8 +60,7 @@ namespace binding {
 InputOutput::InputOutput(
        const map<string, shared_ptr<Option>> &options)
 {
-       for (pair<string, shared_ptr<Option>> o : options)
-       {
+       for (pair<string, shared_ptr<Option>> o : options) {
                const shared_ptr<Option> &opt = o.second;
                assert(opt);
 
@@ -79,10 +79,14 @@ InputOutput::InputOutput(
 
                if (!opt->values().empty())
                        prop = bind_enum(name, values, get, set);
+               else if (def_val.is_of_type(VariantType("b")))
+                       prop = shared_ptr<Property>(new Bool(name, get, set));
                else if (def_val.is_of_type(VariantType("d")))
                        prop = shared_ptr<Property>(new Double(name, 2, "",
-                               nullptr, nullptr, get, set));
-               else if (def_val.is_of_type(VariantType("u")))
+                               none, none, get, set));
+               else if (def_val.is_of_type(VariantType("i")) ||
+                       def_val.is_of_type(VariantType("t")) ||
+                       def_val.is_of_type(VariantType("u")))
                        prop = shared_ptr<Property>(
                                new Int(name, "", none, get, set));
                else if (def_val.is_of_type(VariantType("s")))