X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fbinding%2Finputoutput.cpp;h=df9d3799eb287ccfdb78682d077236aed95cff5f;hb=ebe0a19686181a2ca873219fce38217856b5d82c;hp=30548a82a000d5641f75a3ce0073a1e3e4589d50;hpb=2ad82c2e40b6865481733913a2c32735602f63c4;p=pulseview.git
diff --git a/pv/binding/inputoutput.cpp b/pv/binding/inputoutput.cpp
index 30548a8..df9d379 100644
--- a/pv/binding/inputoutput.cpp
+++ b/pv/binding/inputoutput.cpp
@@ -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 .
*/
#include
@@ -66,6 +65,7 @@ InputOutput::InputOutput(
assert(opt);
const QString name = QString::fromStdString(opt->name());
+ const QString desc = QString::fromStdString(opt->description());
const VariantBase def_val = opt->default_value();
const vector values = opt->values();
@@ -79,20 +79,20 @@ InputOutput::InputOutput(
shared_ptr prop;
if (!opt->values().empty())
- prop = bind_enum(name, values, get, set);
+ prop = bind_enum(name, desc, values, get, set);
else if (def_val.is_of_type(VariantType("b")))
- prop = shared_ptr(new Bool(name, get, set));
+ prop = shared_ptr(new Bool(name, desc, get, set));
else if (def_val.is_of_type(VariantType("d")))
- prop = shared_ptr(new Double(name, 2, "",
+ prop = shared_ptr(new Double(name, desc, 2, "",
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(
- new Int(name, "", none, get, set));
+ new Int(name, desc, "", none, get, set));
else if (def_val.is_of_type(VariantType("s")))
prop = shared_ptr(
- new String(name, get, set));
+ new String(name, desc, get, set));
else
continue;
@@ -106,13 +106,13 @@ const map& InputOutput::options() const
}
shared_ptr InputOutput::bind_enum(
- const QString &name, const vector &values,
+ const QString &name, const QString &desc, const vector &values,
Property::Getter getter, Property::Setter setter)
{
vector< pair > enum_vals;
for (VariantBase var : values)
enum_vals.push_back(make_pair(var, print_gvariant(var)));
- return shared_ptr(new Enum(name, enum_vals, getter, setter));
+ return shared_ptr(new Enum(name, desc, enum_vals, getter, setter));
}
} // namespace binding