* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <boost/foreach.hpp>
+#include <cassert>
#include <QFormLayout>
#include "binding.h"
-using boost::shared_ptr;
+using std::shared_ptr;
namespace pv {
namespace prop {
namespace binding {
-const std::vector< boost::shared_ptr<Property> >& Binding::properties()
+const std::vector< std::shared_ptr<Property> >& Binding::properties()
{
return _properties;
}
void Binding::commit()
{
- BOOST_FOREACH(shared_ptr<pv::prop::Property> p, _properties) {
+ for (shared_ptr<pv::prop::Property> p : _properties) {
assert(p);
p->commit();
}
{
assert(layout);
- BOOST_FOREACH(shared_ptr<pv::prop::Property> p, _properties)
+ for (shared_ptr<pv::prop::Property> p : _properties)
{
assert(p);
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