Use AxisView::get_gui_property API in AxisView class
authorTim Mayberry <mojofunk@gmail.com>
Tue, 30 Aug 2016 12:33:00 +0000 (22:33 +1000)
committerTim Mayberry <mojofunk@gmail.com>
Tue, 18 Apr 2017 23:36:58 +0000 (09:36 +1000)
gtk2_ardour/axis_view.cc

index 1502c8e1ea6a58bca29318bf16ede522d10f3293..3d25b35e173146a2f2668fd823544a332cef6a5c 100644 (file)
@@ -98,19 +98,23 @@ AxisView::set_gui_property (const std::string& property_name, const std::string&
 bool
 AxisView::marked_for_display () const
 {
-       string const v = gui_property ("visible");
-       return (v == "" || PBD::string_is_affirmative (v));
+       bool visible;
+       if (!get_gui_property ("visible", visible)) {
+               return true;
+       }
+       return visible;
 }
 
 bool
 AxisView::set_marked_for_display (bool yn)
 {
-       string const v = gui_property ("visible");
-       if (v == "" || yn != PBD::string_is_affirmative (v)) {
-               set_gui_property ("visible", yn);
-               return true; // things changed
+       bool visible;
+       if (get_gui_property ("visible", visible) && visible == yn) {
+               return false; // nothing changed
        }
-       return false;
+
+       set_gui_property ("visible", yn);
+       return true; // things changed
 }
 
 GUIObjectState&