projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
INSTALL: Fix incorrect gcc/clang minimum versions.
[pulseview.git]
/
pv
/
binding
/
decoder.cpp
diff --git
a/pv/binding/decoder.cpp
b/pv/binding/decoder.cpp
index 7d29e2fdad1b940b963251e190dfa589d77f6591..f2e2e1d579f46eabe7b67104de3a103a6647055a 100644
(file)
--- a/
pv/binding/decoder.cpp
+++ b/
pv/binding/decoder.cpp
@@
-14,8
+14,7
@@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* 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 <libsigrokdecode/libsigrokdecode.h>
*/
#include <libsigrokdecode/libsigrokdecode.h>
@@
-24,8
+23,8
@@
#include <boost/none_t.hpp>
#include <boost/none_t.hpp>
-#include <pv/data/decoderstack.hpp>
#include <pv/data/decode/decoder.hpp>
#include <pv/data/decode/decoder.hpp>
+#include <pv/data/decoderstack.hpp>
#include <pv/prop/double.hpp>
#include <pv/prop/enum.hpp>
#include <pv/prop/int.hpp>
#include <pv/prop/double.hpp>
#include <pv/prop/enum.hpp>
#include <pv/prop/int.hpp>
@@
-73,16
+72,16
@@
Decoder::Decoder(
shared_ptr<Property> prop;
if (opt->values)
shared_ptr<Property> prop;
if (opt->values)
- prop = bind_enum(name, opt, get, set);
+ prop = bind_enum(name,
"",
opt, get, set);
else if (g_variant_is_of_type(opt->def, G_VARIANT_TYPE("d")))
else if (g_variant_is_of_type(opt->def, G_VARIANT_TYPE("d")))
- prop = shared_ptr<Property>(new Double(name, 2, "",
+ prop = shared_ptr<Property>(new Double(name,
"",
2, "",
none, none, get, set));
else if (g_variant_is_of_type(opt->def, G_VARIANT_TYPE("x")))
prop = shared_ptr<Property>(
none, none, get, set));
else if (g_variant_is_of_type(opt->def, G_VARIANT_TYPE("x")))
prop = shared_ptr<Property>(
- new Int(name, "", none, get, set));
+ new Int(name, "",
"",
none, get, set));
else if (g_variant_is_of_type(opt->def, G_VARIANT_TYPE("s")))
prop = shared_ptr<Property>(
else if (g_variant_is_of_type(opt->def, G_VARIANT_TYPE("s")))
prop = shared_ptr<Property>(
- new String(name, get, set));
+ new String(name,
"",
get, set));
else
continue;
else
continue;
@@
-91,7
+90,8
@@
Decoder::Decoder(
}
shared_ptr<Property> Decoder::bind_enum(
}
shared_ptr<Property> Decoder::bind_enum(
- const QString &name, const srd_decoder_option *option,
+ const QString &name, const QString &desc,
+ const srd_decoder_option *option,
Property::Getter getter, Property::Setter setter)
{
vector< pair<Glib::VariantBase, QString> > values;
Property::Getter getter, Property::Setter setter)
{
vector< pair<Glib::VariantBase, QString> > values;
@@
-100,7
+100,7
@@
shared_ptr<Property> Decoder::bind_enum(
values.push_back(make_pair(var, print_gvariant(var)));
}
values.push_back(make_pair(var, print_gvariant(var)));
}
- return shared_ptr<Property>(new Enum(name, values, getter, setter));
+ return shared_ptr<Property>(new Enum(name,
desc,
values, getter, setter));
}
Glib::VariantBase Decoder::getter(const char *id)
}
Glib::VariantBase Decoder::getter(const char *id)
@@
-129,10
+129,7
@@
Glib::VariantBase Decoder::getter(const char *id)
}
}
}
}
- if (val)
- return Glib::VariantBase(val, true);
- else
- return Glib::VariantBase();
+ return (val) ? Glib::VariantBase(val, true) : Glib::VariantBase();
}
void Decoder::setter(const char *id, Glib::VariantBase value)
}
void Decoder::setter(const char *id, Glib::VariantBase value)
@@
-144,5
+141,5
@@
void Decoder::setter(const char *id, Glib::VariantBase value)
decoder_stack_->begin_decode();
}
decoder_stack_->begin_decode();
}
-}
//
binding
-}
//
pv
+}
// namespace
binding
+}
// namespace
pv