[gimp/soc-2009-dynamics] Use GtkTreeStore instead of GtkListStore in GimpContainerTreeView
- From: zhenfeng zhao <zhenfengz src gnome org>
- To: svn-commits-list gnome org
- Subject: [gimp/soc-2009-dynamics] Use GtkTreeStore instead of GtkListStore in GimpContainerTreeView
- Date: Mon, 27 Jul 2009 17:42:46 +0000 (UTC)
commit f7f31650a61d22beef99e921a124f323477ae800
Author: Michael Natterer <mitch gimp org>
Date: Sat Jul 25 17:38:03 2009 +0200
Use GtkTreeStore instead of GtkListStore in GimpContainerTreeView
app/widgets/gimpcontainertreeview.c | 36 ++++++++++++++++++----------------
app/widgets/gimpdatafactoryview.c | 2 +-
app/widgets/gimpitemtreeview.c | 8 +++---
app/widgets/gimplayertreeview.c | 8 +++---
app/widgets/gimpsettingseditor.c | 2 +-
app/widgets/gimptemplateview.c | 2 +-
6 files changed, 30 insertions(+), 28 deletions(-)
---
diff --git a/app/widgets/gimpcontainertreeview.c b/app/widgets/gimpcontainertreeview.c
index 117041e..0e04b0c 100644
--- a/app/widgets/gimpcontainertreeview.c
+++ b/app/widgets/gimpcontainertreeview.c
@@ -179,7 +179,7 @@ gimp_container_tree_view_constructor (GType type,
GimpContainerTreeView *tree_view;
GimpContainerView *view;
GimpContainerBox *box;
- GtkListStore *list;
+ GtkTreeStore *tree;
GObject *object;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
@@ -188,18 +188,18 @@ gimp_container_tree_view_constructor (GType type,
view = GIMP_CONTAINER_VIEW (object);
box = GIMP_CONTAINER_BOX (object);
- list = gtk_list_store_newv (tree_view->n_model_columns,
+ tree = gtk_tree_store_newv (tree_view->n_model_columns,
tree_view->model_columns);
- tree_view->model = GTK_TREE_MODEL (list);
+ tree_view->model = GTK_TREE_MODEL (tree);
tree_view->view = g_object_new (GTK_TYPE_TREE_VIEW,
- "model", list,
+ "model", tree,
"search-column", GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME,
"enable-search", FALSE,
"headers-visible", FALSE,
"has-tooltip", TRUE,
NULL);
- g_object_unref (list);
+ g_object_unref (tree);
gtk_container_add (GTK_CONTAINER (box->scrolled_win),
GTK_WIDGET (tree_view->view));
@@ -482,7 +482,7 @@ gimp_container_tree_view_set (GimpContainerTreeView *tree_view,
name = gimp_viewable_get_description (viewable, NULL);
- gtk_list_store_set (GTK_LIST_STORE (tree_view->model), iter,
+ gtk_tree_store_set (GTK_TREE_STORE (tree_view->model), iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_RENDERER, renderer,
GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME, name,
-1);
@@ -588,10 +588,12 @@ gimp_container_tree_view_insert_item (GimpContainerView *view,
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (view);
GtkTreeIter iter;
+ /* FIXME tree */
+
if (index == -1)
- gtk_list_store_append (GTK_LIST_STORE (tree_view->model), &iter);
+ gtk_tree_store_append (GTK_TREE_STORE (tree_view->model), &iter, NULL);
else
- gtk_list_store_insert (GTK_LIST_STORE (tree_view->model), &iter, index);
+ gtk_tree_store_insert (GTK_TREE_STORE (tree_view->model), &iter, NULL, index);
gimp_container_tree_view_set (tree_view, &iter, viewable);
@@ -608,7 +610,7 @@ gimp_container_tree_view_remove_item (GimpContainerView *view,
if (iter)
{
- gtk_list_store_remove (GTK_LIST_STORE (tree_view->model), iter);
+ gtk_tree_store_remove (GTK_TREE_STORE (tree_view->model), iter);
gtk_tree_view_columns_autosize (tree_view->view);
@@ -664,12 +666,12 @@ gimp_container_tree_view_reorder_item (GimpContainerView *view,
if (new_index == -1 ||
new_index == gimp_container_get_n_children (container) - 1)
{
- gtk_list_store_move_before (GTK_LIST_STORE (tree_view->model),
+ gtk_tree_store_move_before (GTK_TREE_STORE (tree_view->model),
iter, NULL);
}
else if (new_index == 0)
{
- gtk_list_store_move_after (GTK_LIST_STORE (tree_view->model),
+ gtk_tree_store_move_after (GTK_TREE_STORE (tree_view->model),
iter, NULL);
}
else
@@ -688,10 +690,10 @@ gimp_container_tree_view_reorder_item (GimpContainerView *view,
gtk_tree_path_free (path);
if (new_index > old_index)
- gtk_list_store_move_after (GTK_LIST_STORE (tree_view->model),
+ gtk_tree_store_move_after (GTK_TREE_STORE (tree_view->model),
iter, &place_iter);
else
- gtk_list_store_move_before (GTK_LIST_STORE (tree_view->model),
+ gtk_tree_store_move_before (GTK_TREE_STORE (tree_view->model),
iter, &place_iter);
}
}
@@ -718,7 +720,7 @@ gimp_container_tree_view_rename_item (GimpContainerView *view,
GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME, &old_name,
-1);
- gtk_list_store_set (GTK_LIST_STORE (tree_view->model), iter,
+ gtk_tree_store_set (GTK_TREE_STORE (tree_view->model), iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME, name,
-1);
@@ -772,7 +774,7 @@ gimp_container_tree_view_clear_items (GimpContainerView *view)
{
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (view);
- gtk_list_store_clear (GTK_LIST_STORE (tree_view->model));
+ gtk_tree_store_clear (GTK_TREE_STORE (tree_view->model));
/* Clear out renderers from all cells so they don't keep refing the
* viewables (see bug #149906).
@@ -872,7 +874,7 @@ gimp_container_tree_view_name_canceled (GtkCellRendererText *cell,
name = gimp_viewable_get_description (renderer->viewable, NULL);
- gtk_list_store_set (GTK_LIST_STORE (tree_view->model), &iter,
+ gtk_tree_store_set (GTK_TREE_STORE (tree_view->model), &iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME, name,
-1);
@@ -1067,7 +1069,7 @@ gimp_container_tree_view_button_press (GtkWidget *widget,
real_name =
gimp_object_get_name (GIMP_OBJECT (renderer->viewable));
- gtk_list_store_set (GTK_LIST_STORE (tree_view->model),
+ gtk_tree_store_set (GTK_TREE_STORE (tree_view->model),
&iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME,
real_name,
diff --git a/app/widgets/gimpdatafactoryview.c b/app/widgets/gimpdatafactoryview.c
index 7d8da57..474a371 100644
--- a/app/widgets/gimpdatafactoryview.c
+++ b/app/widgets/gimpdatafactoryview.c
@@ -407,7 +407,7 @@ gimp_data_factory_view_tree_name_edited (GtkCellRendererText *cell,
g_free (name);
name = gimp_viewable_get_description (renderer->viewable, NULL);
- gtk_list_store_set (GTK_LIST_STORE (tree_view->model), &iter,
+ gtk_tree_store_set (GTK_TREE_STORE (tree_view->model), &iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME, name,
-1);
g_free (name);
diff --git a/app/widgets/gimpitemtreeview.c b/app/widgets/gimpitemtreeview.c
index e8fa840..ee81739 100644
--- a/app/widgets/gimpitemtreeview.c
+++ b/app/widgets/gimpitemtreeview.c
@@ -635,7 +635,7 @@ gimp_item_tree_view_insert_item (GimpContainerView *view,
iter = parent_view_iface->insert_item (view, viewable, index);
- gtk_list_store_set (GTK_LIST_STORE (tree_view->model), iter,
+ gtk_tree_store_set (GTK_TREE_STORE (tree_view->model), iter,
item_view->priv->model_column_visible,
gimp_item_get_visible (item),
item_view->priv->model_column_linked,
@@ -906,7 +906,7 @@ gimp_item_tree_view_name_edited (GtkCellRendererText *cell,
{
gchar *name = gimp_viewable_get_description (renderer->viewable, NULL);
- gtk_list_store_set (GTK_LIST_STORE (tree_view->model), &iter,
+ gtk_tree_store_set (GTK_TREE_STORE (tree_view->model), &iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME, name,
-1);
g_free (name);
@@ -941,7 +941,7 @@ gimp_item_tree_view_visible_changed (GimpItem *item,
(GimpViewable *) item);
if (iter)
- gtk_list_store_set (GTK_LIST_STORE (tree_view->model), iter,
+ gtk_tree_store_set (GTK_TREE_STORE (tree_view->model), iter,
view->priv->model_column_visible,
gimp_item_get_visible (item),
-1);
@@ -971,7 +971,7 @@ gimp_item_tree_view_linked_changed (GimpItem *item,
(GimpViewable *) item);
if (iter)
- gtk_list_store_set (GTK_LIST_STORE (tree_view->model), iter,
+ gtk_tree_store_set (GTK_TREE_STORE (tree_view->model), iter,
view->priv->model_column_linked,
gimp_item_get_linked (item),
-1);
diff --git a/app/widgets/gimplayertreeview.c b/app/widgets/gimplayertreeview.c
index ac21a53..d96c079 100644
--- a/app/widgets/gimplayertreeview.c
+++ b/app/widgets/gimplayertreeview.c
@@ -893,7 +893,7 @@ gimp_layer_tree_view_floating_selection_changed (GimpImage *image,
iter = gimp_container_view_lookup (view, (GimpViewable *) floating_sel);
if (iter)
- gtk_list_store_set (GTK_LIST_STORE (tree_view->model), iter,
+ gtk_tree_store_set (GTK_TREE_STORE (tree_view->model), iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME_ATTRIBUTES,
layer_view->priv->italic_attrs,
-1);
@@ -911,7 +911,7 @@ gimp_layer_tree_view_floating_selection_changed (GimpImage *image,
iter = gimp_container_view_lookup (view, (GimpViewable *) drawable);
if (iter)
- gtk_list_store_set (GTK_LIST_STORE (tree_view->model), iter,
+ gtk_tree_store_set (GTK_TREE_STORE (tree_view->model), iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME_ATTRIBUTES,
gimp_drawable_has_alpha (drawable) ?
NULL : layer_view->priv->bold_attrs,
@@ -1190,7 +1190,7 @@ gimp_layer_tree_view_mask_update (GimpLayerTreeView *layer_view,
g_signal_connect_closure (mask, "show-changed", closure, FALSE);
}
- gtk_list_store_set (GTK_LIST_STORE (tree_view->model), iter,
+ gtk_tree_store_set (GTK_TREE_STORE (tree_view->model), iter,
layer_view->priv->model_column_mask, renderer,
layer_view->priv->model_column_mask_visible, mask_visible,
-1);
@@ -1423,7 +1423,7 @@ gimp_layer_tree_view_alpha_update (GimpLayerTreeView *view,
{
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (view);
- gtk_list_store_set (GTK_LIST_STORE (tree_view->model), iter,
+ gtk_tree_store_set (GTK_TREE_STORE (tree_view->model), iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME_ATTRIBUTES,
gimp_drawable_has_alpha (GIMP_DRAWABLE (layer)) ?
NULL : view->priv->bold_attrs,
diff --git a/app/widgets/gimpsettingseditor.c b/app/widgets/gimpsettingseditor.c
index b3a4149..79ea54b 100644
--- a/app/widgets/gimpsettingseditor.c
+++ b/app/widgets/gimpsettingseditor.c
@@ -402,7 +402,7 @@ gimp_settings_editor_name_edited (GtkCellRendererText *cell,
g_free (name);
name = gimp_viewable_get_description (renderer->viewable, NULL);
- gtk_list_store_set (GTK_LIST_STORE (tree_view->model), &iter,
+ gtk_tree_store_set (GTK_TREE_STORE (tree_view->model), &iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME, name,
-1);
g_free (name);
diff --git a/app/widgets/gimptemplateview.c b/app/widgets/gimptemplateview.c
index c9e08ee..a789b2d 100644
--- a/app/widgets/gimptemplateview.c
+++ b/app/widgets/gimptemplateview.c
@@ -214,7 +214,7 @@ gimp_template_view_tree_name_edited (GtkCellRendererText *cell,
gchar *name = gimp_viewable_get_description (renderer->viewable,
NULL);
- gtk_list_store_set (GTK_LIST_STORE (tree_view->model), &iter,
+ gtk_tree_store_set (GTK_TREE_STORE (tree_view->model), &iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME, name,
-1);
g_free (name);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]