From 6deedd441f9fadd6250ee4d1793a4bb05c4b6797 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Sun, 29 Sep 2019 09:58:07 -0700 Subject: [PATCH] Make the ptr returned by GncOption::get_ui_item() const but not the GtkWidget it points to. --- libgnucash/app-utils/gnc-option.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libgnucash/app-utils/gnc-option.hpp b/libgnucash/app-utils/gnc-option.hpp index 3260389753..115b43b58e 100644 --- a/libgnucash/app-utils/gnc-option.hpp +++ b/libgnucash/app-utils/gnc-option.hpp @@ -136,7 +136,7 @@ class OptionUIItem { public: GncOptionUIType get_ui_type() { return m_ui_type; } - const void* get_ui_item() {return m_ui_item; } + void* const get_ui_item() {return m_ui_item; } void set_ui_item(void* ui_item) { if (m_ui_type == GncOptionUIType::INTERNAL) @@ -307,7 +307,7 @@ public: { return boost::apply_visitor(GetUITypeVisitor(), m_option); } - const void* get_ui_item() + void* const get_ui_item() { return boost::apply_visitor(GetUIItemVisitor(), m_option); } @@ -418,10 +418,10 @@ private: } }; struct GetUIItemVisitor : - public boost::static_visitor + public boost::static_visitor { template - const void* operator()(OptionType& option) const { + void* const operator()(OptionType& option) const { return option.get_ui_item(); } };