2008-08-04 Claudio Saavedra <csaavedra@igalia.com>
authorClaudio Saavedra <csaavedra@igalia.com>
Mon, 4 Aug 2008 23:54:12 +0000 (23:54 +0000)
committerClaudio Saavedra <csaavedra@igalia.com>
Mon, 4 Aug 2008 23:54:12 +0000 (23:54 +0000)
* src/hildon-touch-selector.c: (hildon_touch_selector_class_init),
(_hildon_touch_selector_set_model),
(hildon_touch_selector_set_model): Move working code to
_hildon_touch_selector_set_mode(). Call the class method instead.

* src/hildon-touch-selector.h: Add (*set_model) to
HildonTouchSelectorClass.

Make hildon_touch_selector_set_model() a virtual method, so that
derived classes can extend it and do fancy stuff with the model.

ChangeLog
src/hildon-touch-selector.c
src/hildon-touch-selector.h

index 41e9ed7..c079b54 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
 2008-08-04  Claudio Saavedra  <csaavedra@igalia.com>
 
+       * src/hildon-touch-selector.c: (hildon_touch_selector_class_init),
+       (_hildon_touch_selector_set_model),
+       (hildon_touch_selector_set_model): Move working code to
+       _hildon_touch_selector_set_mode(). Call the class method instead.
+
+       * src/hildon-touch-selector.h: Add (*set_model) to
+       HildonTouchSelectorClass.
+
+       Make hildon_touch_selector_set_model() a virtual method, so that
+       derived classes can extend it and do fancy stuff with the model.
+
+2008-08-04  Claudio Saavedra  <csaavedra@igalia.com>
+
        * configure.ac: Set back the tarname in AC_INIT to hildon.
 
 2008-08-04  Kimmo Hämäläinen <kimmo.hamalainen@nokia.com>
index 844df85..4cf88e7 100644 (file)
@@ -94,6 +94,10 @@ static SelectorColumn *_create_new_column (HildonTouchSelector * selector,
 static gboolean _hildon_touch_selector_center_on_selected_items (gpointer data);
 
 static void
+_hildon_touch_selector_set_model (HildonTouchSelector * selector,
+                                  gint num_column, GtkTreeModel * model);
+
+static void
 hildon_touch_selector_class_init (HildonTouchSelectorClass * class)
 {
   GObjectClass *gobject_class;
@@ -114,6 +118,8 @@ hildon_touch_selector_class_init (HildonTouchSelectorClass * class)
   /* GtkContainer */
   container_class->remove = hildon_touch_selector_remove;
 
+  /* HildonTouchSelector */
+  class->set_model = _hildon_touch_selector_set_model;
 
   /* signals */
   /**
@@ -884,16 +890,12 @@ hildon_touch_selector_get_model (HildonTouchSelector * selector, gint column)
   return current_column->model;
 }
 
-void
-hildon_touch_selector_set_model (HildonTouchSelector * selector,
+static void
+_hildon_touch_selector_set_model (HildonTouchSelector * selector,
                                  gint num_column, GtkTreeModel * model)
 {
   SelectorColumn *column = NULL;
 
-  g_return_if_fail (HILDON_TOUCH_SELECTOR (selector));
-  g_return_if_fail (num_column <
-                    hildon_touch_selector_get_num_columns (selector));
-
   column =
     (SelectorColumn *) g_slist_nth_data (selector->priv->columns, num_column);
 
@@ -901,6 +903,15 @@ hildon_touch_selector_set_model (HildonTouchSelector * selector,
   gtk_tree_view_set_model (column->tree_view, column->model);
 }
 
+void
+hildon_touch_selector_set_model (HildonTouchSelector * selector,
+                                 gint num_column, GtkTreeModel * model)
+{
+  g_return_if_fail (HILDON_TOUCH_SELECTOR (selector));
+  g_return_if_fail (num_column < hildon_touch_selector_get_num_columns (selector));
+
+  HILDON_TOUCH_SELECTOR_GET_CLASS (selector)->set_model (selector, num_column, model);
+}
 /**
  * hildon_touch_selector_get_active_text
  * @selector: the #HildonTouchSelector
index 77e6888..7906dfa 100644 (file)
@@ -52,6 +52,9 @@ struct _HildonTouchSelectorClass
 
   /* signals */
   void (*changed) (HildonTouchSelector * selector, gint column);
+
+  /* virtual methods */
+  void (*set_model) (HildonTouchSelector *selector, gint column, GtkTreeModel *model);
 };
 
 typedef enum