workaround changes in glibmm 2.49.x
authorNils Philippsen <nils@tiptoe.de>
Thu, 4 Aug 2016 07:48:47 +0000 (09:48 +0200)
committerNils Philippsen <nils@tiptoe.de>
Thu, 4 Aug 2016 07:52:22 +0000 (09:52 +0200)
Glib::RefPtr defines the operator bool() as explicit which breaks
comparisons like "some_ref_ptr == 0" or "... != 0".

https://bugzilla.gnome.org/show_bug.cgi?id=769502

gtk2_ardour/ardour_ui.cc
gtk2_ardour/fft_graph.cc
gtk2_ardour/startup.cc
libs/gtkmm2ext/actions.cc
libs/gtkmm2ext/fastmeter.cc

index d6671205a77bf28b1151aaed9db5791e03db52bd..e9cf5b204100d3a5250d388edebc9ce83102c6a0 100644 (file)
@@ -5397,16 +5397,16 @@ ARDOUR_UI::setup_toplevel_window (Gtk::Window& window, const string& name, void*
 
        if (window_icons.empty()) {
                Glib::RefPtr<Gdk::Pixbuf> icon;
-               if ((icon = ::get_icon (PROGRAM_NAME "-icon_16px")) != 0) {
+               if ((icon = ::get_icon (PROGRAM_NAME "-icon_16px"))) {
                        window_icons.push_back (icon);
                }
-               if ((icon = ::get_icon (PROGRAM_NAME "-icon_22px")) != 0) {
+               if ((icon = ::get_icon (PROGRAM_NAME "-icon_22px"))) {
                        window_icons.push_back (icon);
                }
-               if ((icon = ::get_icon (PROGRAM_NAME "-icon_32px")) != 0) {
+               if ((icon = ::get_icon (PROGRAM_NAME "-icon_32px"))) {
                        window_icons.push_back (icon);
                }
-               if ((icon = ::get_icon (PROGRAM_NAME "-icon_48px")) != 0) {
+               if ((icon = ::get_icon (PROGRAM_NAME "-icon_48px"))) {
                        window_icons.push_back (icon);
                }
        }
index abed0c70d7417b9b0a8bff31e0db36ff543599d2..ec54acbaaae32e18e05eef28bc9ecbfb173897af 100644 (file)
@@ -312,7 +312,7 @@ FFTGraph::draw_scales (cairo_t* cr)
        cairo_line_to (cr, width - 3              , .5 + v_margin); // 5
        cairo_stroke (cr);
 
-       if (layout == 0) {
+       if (! layout) {
                layout = create_pango_layout ("");
                layout->set_font_description (get_style ()->get_font ());
        }
index 58c1cfc7ad403bdf713771b12a09538ffb588ea1..12f98916bf30188048617390943b32bebd83cf7f 100644 (file)
@@ -80,23 +80,23 @@ ArdourStartup::ArdourStartup ()
        set_position (WIN_POS_CENTER);
        set_border_width (12);
 
-       if ((icon_pixbuf = ::get_icon (PROGRAM_NAME "-icon_48px")) == 0) {
+       if (! (icon_pixbuf = ::get_icon (PROGRAM_NAME "-icon_48px"))) {
                throw failed_constructor();
        }
 
        list<Glib::RefPtr<Gdk::Pixbuf> > window_icons;
        Glib::RefPtr<Gdk::Pixbuf> icon;
 
-       if ((icon = ::get_icon (PROGRAM_NAME "-icon_16px")) != 0) {
+       if ((icon = ::get_icon (PROGRAM_NAME "-icon_16px"))) {
                window_icons.push_back (icon);
        }
-       if ((icon = ::get_icon (PROGRAM_NAME "-icon_22px")) != 0) {
+       if ((icon = ::get_icon (PROGRAM_NAME "-icon_22px"))) {
                window_icons.push_back (icon);
        }
-       if ((icon = ::get_icon (PROGRAM_NAME "-icon_32px")) != 0) {
+       if ((icon = ::get_icon (PROGRAM_NAME "-icon_32px"))) {
                window_icons.push_back (icon);
        }
-       if ((icon = ::get_icon (PROGRAM_NAME "-icon_48px")) != 0) {
+       if ((icon = ::get_icon (PROGRAM_NAME "-icon_48px"))) {
                window_icons.push_back (icon);
        }
        if (!window_icons.empty ()) {
index 3aa36b98db28f6c219606891ea744a2b917bb19d..840c9dc4a29012285b62468f8907b813e5f9163a 100644 (file)
@@ -167,7 +167,7 @@ ActionManager::get_action (const char* group_name, const char* action_name)
           gtkmm2.6, so we fall back to the C level.
        */
 
-       if (ui_manager == 0) {
+       if (! ui_manager) {
                return RefPtr<Action> ();
        }
 
index c144a963bbd673df7e6734a1b998140f3a8278c6..f3928910bca7de037c783fdb4e19535ccbb69886 100644 (file)
@@ -731,7 +731,7 @@ FastMeter::set (float lvl, float peak)
 
        Glib::RefPtr<Gdk::Window> win;
 
-       if ((win = get_window()) == 0) {
+       if (! (win = get_window())) {
                queue_draw ();
                return;
        }