[glom] Replace some uses of g_object_set(, NULL) with reset_value().



commit ac16fbf95c2e9512ea57bce8eff35b623f3050da
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Nov 7 10:32:57 2013 +0100

    Replace some uses of g_object_set(, NULL) with reset_value().
    
    This avoids the issue of whether "" is accepted as NULL, though I
    think newer glibmm would pass NULL for all "" anyway.

 .../datawidget/combochoiceswithtreemodel.cc        |    3 +--
 glom/mode_data/db_adddel/db_adddel.cc              |    4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/glom/mode_data/datawidget/combochoiceswithtreemodel.cc 
b/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
index 573550d..d07464a 100644
--- a/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
+++ b/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
@@ -391,8 +391,7 @@ void ComboChoicesWithTreeModel::set_cell_for_field_value(Gtk::CellRenderer* cell
         if(!fg_color.empty())
           pDerived->property_foreground() = fg_color;
         else
-          //TODO: Remove this when this GTK+ bug is fixed: https://bugzilla.gnome.org/show_bug.cgi?id=667415
-          g_object_set(pDerived->gobj(), "foreground", (const char*)0, (gpointer)0);
+          pDerived->property_foreground().reset_value();
       }
 
       break;
diff --git a/glom/mode_data/db_adddel/db_adddel.cc b/glom/mode_data/db_adddel/db_adddel.cc
index 773ee78..b3d1ac5 100644
--- a/glom/mode_data/db_adddel/db_adddel.cc
+++ b/glom/mode_data/db_adddel/db_adddel.cc
@@ -1980,8 +1980,8 @@ void DbAddDel::treeviewcolumn_on_cell_data(Gtk::CellRenderer* renderer, const Gt
                  field->get_formatting_used().get_text_format_color_foreground_to_use(value);
                if(!fg_color.empty())
                    pDerived->property_foreground() = fg_color;
-               else //TODO: Remove this when this GTK+ bug is fixed: 
https://bugzilla.gnome.org/show_bug.cgi?id=667415
-                   g_object_set(pDerived->gobj(), "foreground", (const char*)0, (gpointer)0);
+               else
+                   pDerived->property_foreground().reset_value();
             }
           }
 


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