[gtkmm] Demos: Fix after introduction of Glib::UStringView



commit 612f2337f7675e10456b30b442b269d92ce586c7
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Mon Dec 2 15:52:04 2019 +0100

    Demos: Fix after introduction of Glib::UStringView
    
    Glib::ustring::compare() and operator==() now take a Glib::UStringView
    instead of a const Glib::ustring&. A Gtk::TreeValueProxy can't be implicitly
    converted to a Glib::UStringView.
    
    * demos/gtk-demo/example_iconbrowser.cc: Convert
    row[m_store->m_columns.context_id] to a Glib::ustring before it's used
    in a comparison.
    * demos/gtk-demo/example_iconview.cc: Use row_b.get_value(
    m_columns.display_name) instead of row_b[m_columns.display_name].
    row_b.get_value() returns a Glib::ustring. row_b[] returns a
    Gtk::TreeValueProxy.

 demos/gtk-demo/example_iconbrowser.cc | 2 +-
 demos/gtk-demo/example_iconview.cc    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/demos/gtk-demo/example_iconbrowser.cc b/demos/gtk-demo/example_iconbrowser.cc
index 13fb92b0..0da67114 100644
--- a/demos/gtk-demo/example_iconbrowser.cc
+++ b/demos/gtk-demo/example_iconbrowser.cc
@@ -875,7 +875,7 @@ bool Example_IconBrowser::is_icon_visible(const Gtk::TreeModel::const_iterator&
   }
   else
   {
-    const auto context_id = row[m_store->m_columns.context_id];
+    const Glib::ustring context_id = row[m_store->m_columns.context_id];
     visible = context_id == m_current_context_id;
   }
   return visible;
diff --git a/demos/gtk-demo/example_iconview.cc b/demos/gtk-demo/example_iconview.cc
index 27878269..4629ae9c 100644
--- a/demos/gtk-demo/example_iconview.cc
+++ b/demos/gtk-demo/example_iconview.cc
@@ -146,7 +146,7 @@ int Example_IconView::on_model_sort(const Gtk::TreeModel::const_iterator& a, con
   else
   {
     Glib::ustring name_a = row_a[m_columns.display_name];
-    return name_a.compare( row_b[m_columns.display_name] );
+    return name_a.compare(row_b.get_value(m_columns.display_name));
   }
 }
 


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