[gtkmm] Fix build of example_headerbar.cc



commit 62a630a2d13ec2fca8f6f797474c89e5452f10d7
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Sep 19 12:25:39 2014 +0800

    Fix build of example_headerbar.cc
    
    Make the type of the variable icon a Glib::RefPtr<const Gio::Icon> so that
    it will build on Visual Studio, or when GTKMM_DISABLE_DEPRECATED is not
    defined.
    
        * demos/gtk-demo/example_headerbar.cc: Fix build on Visual Studio
          and when GTKMM_DISABLE_DEPRECATED is not defined, and add note
          regarding to the usage of 'const'.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=736847

 demos/gtk-demo/example_headerbar.cc |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/demos/gtk-demo/example_headerbar.cc b/demos/gtk-demo/example_headerbar.cc
index 89d0641..2c7ce6a 100644
--- a/demos/gtk-demo/example_headerbar.cc
+++ b/demos/gtk-demo/example_headerbar.cc
@@ -80,7 +80,10 @@ Example_HeaderBar::~Example_HeaderBar()
 
 void Example_HeaderBar::configure_send_receive_button()
 {
-  Glib::RefPtr<Gio::ThemedIcon> icon = Gio::ThemedIcon::create("mail-send-receive-symbolic", false);
+  /* the 'const' is required, to avoid C2668/Ambiguous call errors
+     on some compilers, such as Visual Studio or when compiling without
+     GTKMM_DISABLE_DEPRECATED on g++ */
+  Glib::RefPtr<const Gio::Icon> icon = Gio::ThemedIcon::create("mail-send-receive-symbolic", false);
 
   m_send_receive_image.set(icon, Gtk::ICON_SIZE_BUTTON);
   m_send_receive_button.add(m_send_receive_image);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]