]> sigrok.org Git - pulseview.git/commitdiff
Moved print_gvariant into DeviceOptions
authorJoel Holdsworth <redacted>
Mon, 10 Mar 2014 22:11:11 +0000 (23:11 +0100)
committerJoel Holdsworth <redacted>
Thu, 13 Mar 2014 17:00:33 +0000 (17:00 +0000)
pv/prop/binding/binding.cpp
pv/prop/binding/binding.h
pv/prop/binding/decoderoptions.h
pv/prop/binding/deviceoptions.cpp
pv/prop/binding/deviceoptions.h

index ec3127254b71c8e82085b4cb0f802020c65e2aa0..3a6c73fb09afbdc162e181d54b7718c62d45be5b 100644 (file)
@@ -73,6 +73,22 @@ QWidget* Binding::get_property_form(QWidget *parent,
        return form;
 }
 
+QString Binding::print_gvariant(GVariant *const gvar)
+{
+       QString s;
+
+       if (g_variant_is_of_type(gvar, G_VARIANT_TYPE("s")))
+               s = QString::fromUtf8(g_variant_get_string(gvar, NULL));
+       else
+       {
+               gchar *const text = g_variant_print(gvar, FALSE);
+               s = QString::fromUtf8(text);
+               g_free(text);
+       }
+
+       return s;
+}
+
 } // binding
 } // prop
 } // pv
index 9b63c16214f1fffc9e83bd27245b1600d0a2dedd..89c1acbc88628779ad4ddad0797aed5590745230 100644 (file)
 #ifndef PULSEVIEW_PV_PROP_BINDING_BINDING_H
 #define PULSEVIEW_PV_PROP_BINDING_BINDING_H
 
+#include <glib.h>
+
 #include <vector>
 #include <boost/shared_ptr.hpp>
 
+#include <QString>
+
 class QFormLayout;
 class QWidget;
 
@@ -47,6 +51,8 @@ public:
        QWidget* get_property_form(QWidget *parent,
                bool auto_commit = false) const;
 
+       static QString print_gvariant(GVariant *const gvar);
+
 protected:
        std::vector< boost::shared_ptr<Property> > _properties;
 };
index 62f4fe184cb766e51b7affdfeab35ede0ad851fa..c08f1017fb2a822106f21a603f7be76768d66050 100644 (file)
@@ -21,8 +21,6 @@
 #ifndef PULSEVIEW_PV_PROP_BINDING_DECODEROPTIONS_H
 #define PULSEVIEW_PV_PROP_BINDING_DECODEROPTIONS_H
 
-#include <glib.h>
-
 #include "binding.h"
 
 namespace pv {
index ea8f4b4218463e1c6e5ab03308ca6358d0066df2..26d4ef2a8fabe72dd3047525ca7e7c22112f0e99 100644 (file)
@@ -157,22 +157,6 @@ void DeviceOptions::bind_int(const QString &name, int key, QString suffix,
                bind(&device::DevInst::set_config, _dev_inst, _group, key, _1))));
 }
 
-QString DeviceOptions::print_gvariant(GVariant *const gvar)
-{
-       QString s;
-
-       if (g_variant_is_of_type(gvar, G_VARIANT_TYPE("s")))
-               s = QString::fromUtf8(g_variant_get_string(gvar, NULL));
-       else
-       {
-               gchar *const text = g_variant_print(gvar, FALSE);
-               s = QString::fromUtf8(text);
-               g_free(text);
-       }
-
-       return s;
-}
-
 QString DeviceOptions::print_timebase(GVariant *const gvar)
 {
        uint64_t p, q;
index 4a6eff2eb1694f07ef61aa43b7feef2d95f191e2..341d3d93ded3973b895aa2e5a29f383109b09adf 100644 (file)
@@ -56,8 +56,6 @@ private:
        void bind_int(const QString &name, int key, QString suffix,
                boost::optional< std::pair<int64_t, int64_t> > range);
 
-       static QString print_gvariant(GVariant *const gvar);
-
        static QString print_timebase(GVariant *const gvar);
        static QString print_vdiv(GVariant *const gvar);
        static QString print_voltage_threshold(GVariant *const gvar);