aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2007-04-20 02:53:33 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2007-04-20 02:53:33 +0800
commit64977cb1bcc55bf4c7c0fc38cd3d047b1e6a25c6 (patch)
tree4ebe95239bef43cb97c0e46aa8194d44e6c88be6 /widgets/table
parentbb05f6e6d0541bf29c8dde4e264cc7c23ba52fbb (diff)
downloadgsoc2013-evolution-64977cb1bcc55bf4c7c0fc38cd3d047b1e6a25c6.tar
gsoc2013-evolution-64977cb1bcc55bf4c7c0fc38cd3d047b1e6a25c6.tar.gz
gsoc2013-evolution-64977cb1bcc55bf4c7c0fc38cd3d047b1e6a25c6.tar.bz2
gsoc2013-evolution-64977cb1bcc55bf4c7c0fc38cd3d047b1e6a25c6.tar.lz
gsoc2013-evolution-64977cb1bcc55bf4c7c0fc38cd3d047b1e6a25c6.tar.xz
gsoc2013-evolution-64977cb1bcc55bf4c7c0fc38cd3d047b1e6a25c6.tar.zst
gsoc2013-evolution-64977cb1bcc55bf4c7c0fc38cd3d047b1e6a25c6.zip
Massive code cleanup (bug #429422)
svn path=/trunk/; revision=33432
Diffstat (limited to 'widgets/table')
-rw-r--r--widgets/table/ChangeLog50
-rw-r--r--widgets/table/e-cell-combo.c2
-rw-r--r--widgets/table/e-cell-date.c3
-rw-r--r--widgets/table/e-cell-text.c4
-rw-r--r--widgets/table/e-cell-tree.c6
-rw-r--r--widgets/table/e-table-config.c3
-rw-r--r--widgets/table/e-table-example-1.c2
-rw-r--r--widgets/table/e-table-example-2.c2
-rw-r--r--widgets/table/e-table-extras.c6
-rw-r--r--widgets/table/e-table-header-item.c8
-rw-r--r--widgets/table/e-table-header.c8
-rw-r--r--widgets/table/e-table-item.c16
-rw-r--r--widgets/table/e-table-model.c14
-rw-r--r--widgets/table/e-table-search.c4
-rw-r--r--widgets/table/e-table-size-test.c2
-rw-r--r--widgets/table/e-table-sort-info.c4
-rw-r--r--widgets/table/e-table-sorting-utils.c6
-rw-r--r--widgets/table/e-table.c11
-rw-r--r--widgets/table/e-tree-memory.c6
-rw-r--r--widgets/table/e-tree-model.c18
-rw-r--r--widgets/table/e-tree-sorted.c2
-rw-r--r--widgets/table/e-tree.c12
-rw-r--r--widgets/table/test-table.c2
23 files changed, 122 insertions, 69 deletions
diff --git a/widgets/table/ChangeLog b/widgets/table/ChangeLog
index ee46792ce3..43d102a326 100644
--- a/widgets/table/ChangeLog
+++ b/widgets/table/ChangeLog
@@ -1,3 +1,53 @@
+2007-04-19 Matthew Barnes <mbarnes@redhat.com>
+
+ ** Fixes part of bug #429422
+
+ * e-table-size-test.c (create_table):
+ * test-table.c (main):
+ * e-cell-combo.c (e_cell_combo_show_popup):
+ * e-table-example-1.c (create_table):
+ * e-tree.c (header_canvas_size_allocate), (e_tree_setup_header):
+ * e-cell-text.c (ect_show_tooltip):
+ * e-table-example-2.c (create_table):
+ * e-table.c (header_canvas_size_allocate):
+ Use gtk_widget_set_size_request() or g_object_set() instead of
+ gtk_widget_set_usize().
+
+ * e-cell-tree.c (e_cell_tree_construct):
+ * e-table-header-item.c (ethi_header_context_menu), (ethi_event):
+ * e-table-extras.c (e_table_extras_add_cell):
+ Use g_object_ref_sink() instead of gtk_object_sink().
+
+ * e-cell-date.c (ecd_get_text):
+ e_strdup_strip() is dead; just do it manually.
+
+ * e-table-header-item.c (ethi_header_context_menu):
+ Use gtk_radio_menu_item_get_group() instead of
+ gtk_radio_menu_item_group().
+
+ * e-table-search.c (e_table_search_class_init):
+ * e-table-sort-info.c (e_table_sort_info_class_init):
+ * e-tree-model.c (e_tree_model_class_init):
+ * e-tree-memory.c (e_tree_memory_class_init):
+ * e-table-header.c (e_table_header_class_init):
+ * e-table-model.c (e_table_model_class_init):
+ * e-table-config.c (config_class_init):
+ * e-tree-sorted.c (e_tree_sorted_class_init):
+ Use G_TYPE_FROM_CLASS() instead of E_OBJECT_CLASS_TYPE().
+
+ * e-table-item.c (eti_dispose), (eti_unrealize), (eti_event):
+ Use g_source_remove() instead of gtk_timeout_remove().
+
+ * e-table-item.c (eti_event):
+ Use g_timeout_add() instead of gtk_timeout_add().
+
+ * e-tree.c (et_dispose):
+ e_free_string_list() is dead; just do it manually.
+
+ * e-tree-memory.c (e_tree_memory_sort_node):
+ * e-table-sorting-utils.c (e_table_sorting_utils_sort):
+ Use g_qsort_with_data() instead of e_sort().
+
2007-03-29 Matthew Barnes <mbarnes@redhat.com>
* e-table-header-utils.c:
diff --git a/widgets/table/e-cell-combo.c b/widgets/table/e-cell-combo.c
index 629a3588ed..e7fc235a05 100644
--- a/widgets/table/e-cell-combo.c
+++ b/widgets/table/e-cell-combo.c
@@ -365,7 +365,7 @@ e_cell_combo_show_popup (ECellCombo *ecc, int row, int view_col)
}
gtk_widget_set_uposition (ecc->popup_window, x, y);
- gtk_widget_set_usize (ecc->popup_window, width, height);
+ gtk_widget_set_size_request (ecc->popup_window, width, height);
gtk_widget_realize (ecc->popup_window);
gdk_window_resize (ecc->popup_window->window, width, height);
gtk_widget_show (ecc->popup_window);
diff --git a/widgets/table/e-cell-date.c b/widgets/table/e-cell-date.c
index d2319ee61e..85f2324ad4 100644
--- a/widgets/table/e-cell-date.c
+++ b/widgets/table/e-cell-date.c
@@ -108,8 +108,7 @@ ecd_get_text(ECellText *cell, ETableModel *model, int col, int row)
while ((temp = strstr (temp, " "))) {
memmove (temp, temp + 1, strlen (temp));
}
- temp = e_strdup_strip (buf);
- return temp;
+ return g_strstrip (g_strdup (buf));
}
static void
diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c
index 25a00085f8..47088029a6 100644
--- a/widgets/table/e-cell-text.c
+++ b/widgets/table/e-cell-text.c
@@ -1623,8 +1623,8 @@ ect_show_tooltip (ECellView *ecell_view,
"x2", (double) tooltip_width + 6,
"y2", (double) tooltip->row_height + 1,
NULL);
- gtk_widget_set_usize (window, tooltip_width + 6,
- tooltip->row_height + 1);
+ gtk_widget_set_size_request (window, tooltip_width + 6,
+ tooltip->row_height + 1);
gnome_canvas_set_scroll_region (GNOME_CANVAS (canvas), 0.0, 0.0,
(double) tooltip_width + 6,
(double) tooltip_height);
diff --git a/widgets/table/e-cell-tree.c b/widgets/table/e-cell-tree.c
index fc7f835fd1..8853a7a132 100644
--- a/widgets/table/e-cell-tree.c
+++ b/widgets/table/e-cell-tree.c
@@ -873,10 +873,8 @@ e_cell_tree_construct (ECellTree *ect,
ECell *subcell)
{
ect->subcell = subcell;
- if (subcell) {
- g_object_ref (subcell);
- gtk_object_sink (GTK_OBJECT (subcell));
- }
+ if (subcell)
+ g_object_ref_sink (subcell);
if (open_pixbuf)
ect->open_pixbuf = open_pixbuf;
else
diff --git a/widgets/table/e-table-config.c b/widgets/table/e-table-config.c
index f32f09cd21..7af4a8fb00 100644
--- a/widgets/table/e-table-config.c
+++ b/widgets/table/e-table-config.c
@@ -33,7 +33,6 @@
#include <string.h>
#include <gtk/gtk.h>
-#include <libgnomeui/gnome-propertybox.h>
#include <glade/glade.h>
#include <glib/gi18n.h>
@@ -138,7 +137,7 @@ config_class_init (GObjectClass *object_class)
e_table_config_signals [CHANGED] =
g_signal_new ("changed",
- E_OBJECT_CLASS_TYPE (object_class),
+ G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ETableConfigClass, changed),
(GSignalAccumulator) NULL, NULL,
diff --git a/widgets/table/e-table-example-1.c b/widgets/table/e-table-example-1.c
index 37ac85770f..bbfc070d62 100644
--- a/widgets/table/e-table-example-1.c
+++ b/widgets/table/e-table-example-1.c
@@ -281,7 +281,7 @@ create_table (void)
gtk_container_add (GTK_CONTAINER (window), frame);
/* Size the initial window. */
- gtk_widget_set_usize (window, 200, 200);
+ gtk_widget_set_size_request (window, 200, 200);
/* Show it all. */
gtk_widget_show_all (window);
diff --git a/widgets/table/e-table-example-2.c b/widgets/table/e-table-example-2.c
index a442ee2546..a91087c82a 100644
--- a/widgets/table/e-table-example-2.c
+++ b/widgets/table/e-table-example-2.c
@@ -327,7 +327,7 @@ create_table ()
gtk_container_add (GTK_CONTAINER (window), frame);
/* Size the initial window. */
- gtk_widget_set_usize (window, 200, 200);
+ gtk_widget_set_size_request (window, 200, 200);
/* Show it all. */
gtk_widget_show_all (window);
}
diff --git a/widgets/table/e-table-extras.c b/widgets/table/e-table-extras.c
index 5b13c4e5f4..93013bbd78 100644
--- a/widgets/table/e-table-extras.c
+++ b/widgets/table/e-table-extras.c
@@ -209,10 +209,8 @@ e_table_extras_add_cell (ETableExtras *extras,
g_object_unref (old_cell);
}
- if (cell) {
- g_object_ref (cell);
- gtk_object_sink (GTK_OBJECT (cell));
- }
+ if (cell)
+ g_object_ref_sink (cell);
g_hash_table_insert (extras->cells, g_strdup(id), cell);
}
diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c
index 596fbbcb73..7dff0b5469 100644
--- a/widgets/table/e-table-header-item.c
+++ b/widgets/table/e-table-header-item.c
@@ -1552,7 +1552,7 @@ ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event)
/* Custom */
menu_item = gtk_radio_menu_item_new_with_label (group, _("Custom"));
- group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (menu_item));
+ group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_item));
gtk_widget_show (menu_item);
gtk_menu_shell_prepend (GTK_MENU_SHELL (sub_menu), menu_item);
if (sort_col == -1)
@@ -1587,8 +1587,7 @@ ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event)
g_signal_connect (menu_item, "activate", G_CALLBACK (sort_by_id), ethi);
}
- g_object_ref (popup);
- gtk_object_sink (GTK_OBJECT (popup));
+ g_object_ref_sink (popup);
g_signal_connect (popup, "selection-done",
G_CALLBACK (free_popup_info), info);
e_popup_menu (popup, (GdkEvent *) event);
@@ -1814,8 +1813,7 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e)
((e_table_header_count (ethi->eth) > 1) ? 0 : 8),
((e_table_sort_info_get_can_group (ethi->sort_info)) ? 0 : 16) +
128, info, GETTEXT_PACKAGE);
- g_object_ref (popup);
- gtk_object_sink (GTK_OBJECT (popup));
+ g_object_ref_sink (popup);
g_signal_connect (popup, "selection-done",
G_CALLBACK (free_popup_info), info);
e_popup_menu (popup, NULL);
diff --git a/widgets/table/e-table-header.c b/widgets/table/e-table-header.c
index 2acfb1c446..5e7d28300b 100644
--- a/widgets/table/e-table-header.c
+++ b/widgets/table/e-table-header.c
@@ -277,7 +277,7 @@ e_table_header_class_init (GObjectClass *object_class)
eth_signals [STRUCTURE_CHANGE] =
g_signal_new ("structure_change",
- E_OBJECT_CLASS_TYPE (object_class),
+ G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ETableHeaderClass, structure_change),
(GSignalAccumulator) NULL, NULL,
@@ -285,7 +285,7 @@ e_table_header_class_init (GObjectClass *object_class)
G_TYPE_NONE, 0);
eth_signals [DIMENSION_CHANGE] =
g_signal_new ("dimension_change",
- E_OBJECT_CLASS_TYPE (object_class),
+ G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ETableHeaderClass, dimension_change),
(GSignalAccumulator) NULL, NULL,
@@ -293,7 +293,7 @@ e_table_header_class_init (GObjectClass *object_class)
G_TYPE_NONE, 1, G_TYPE_INT);
eth_signals [EXPANSION_CHANGE] =
g_signal_new ("expansion_change",
- E_OBJECT_CLASS_TYPE (object_class),
+ G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ETableHeaderClass, expansion_change),
(GSignalAccumulator) NULL, NULL,
@@ -301,7 +301,7 @@ e_table_header_class_init (GObjectClass *object_class)
G_TYPE_NONE, 0);
eth_signals [REQUEST_WIDTH] =
g_signal_new ("request_width",
- E_OBJECT_CLASS_TYPE (object_class),
+ G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ETableHeaderClass, request_width),
(GSignalAccumulator) NULL, NULL,
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c
index 72a3decfca..c4b5ea17d0 100644
--- a/widgets/table/e-table-item.c
+++ b/widgets/table/e-table-item.c
@@ -1446,7 +1446,7 @@ eti_dispose (GObject *object)
eti->tooltip->foreground = NULL;
if (eti->tooltip->timer) {
- gtk_timeout_remove (eti->tooltip->timer);
+ g_source_remove (eti->tooltip->timer);
eti->tooltip->timer = 0;
}
g_free (eti->tooltip);
@@ -1782,7 +1782,7 @@ eti_unrealize (GnomeCanvasItem *item)
eti->tooltip->foreground = NULL;
}
if (eti->tooltip->timer) {
- gtk_timeout_remove (eti->tooltip->timer);
+ g_source_remove (eti->tooltip->timer);
eti->tooltip->timer = 0;
}
}
@@ -2288,7 +2288,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
d(g_print("%s: GDK_BUTTON_PRESS received, button %d\n", __FUNCTION__, e->button.button));
if (eti->tooltip->timer) {
- gtk_timeout_remove (eti->tooltip->timer);
+ g_source_remove (eti->tooltip->timer);
eti->tooltip->timer = 0;
}
@@ -2429,7 +2429,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
}
if (eti->tooltip->timer) {
- gtk_timeout_remove (eti->tooltip->timer);
+ g_source_remove (eti->tooltip->timer);
eti->tooltip->timer = 0;
}
e_canvas_hide_tooltip (E_CANVAS(GNOME_CANVAS_ITEM(eti)->canvas));
@@ -2597,12 +2597,12 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
#ifdef DO_TOOLTIPS
if (!g_getenv ("GAL_DONT_DO_TOOLTIPS")) {
if (eti->tooltip->timer)
- gtk_timeout_remove (eti->tooltip->timer);
+ g_source_remove (eti->tooltip->timer);
eti->tooltip->col = col;
eti->tooltip->row = row;
eti->tooltip->cx = e->motion.x;
eti->tooltip->cy = e->motion.y;
- eti->tooltip->timer = gtk_timeout_add (100, (GSourceFunc)_do_tooltip, eti);
+ eti->tooltip->timer = g_timeout_add (100, (GSourceFunc)_do_tooltip, eti);
}
#endif
@@ -2636,7 +2636,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
NULL);
if (eti->tooltip->timer) {
- gtk_timeout_remove (eti->tooltip->timer);
+ g_source_remove (eti->tooltip->timer);
eti->tooltip->timer = 0;
}
e_canvas_hide_tooltip (E_CANVAS(GNOME_CANVAS_ITEM(eti)->canvas));
@@ -2850,7 +2850,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
case GDK_ENTER_NOTIFY:
d(g_print("%s: %s received\n", __FUNCTION__, leave ? "GDK_LEAVE_NOTIFY" : "GDK_ENTER_NOTIFY"));
if (eti->tooltip->timer)
- gtk_timeout_remove (eti->tooltip->timer);
+ g_source_remove (eti->tooltip->timer);
eti->tooltip->timer = 0;
if (eti->motion_row != -1 && eti->motion_col != -1)
return_val = eti_e_cell_event (eti, eti->cell_views [eti->motion_col],
diff --git a/widgets/table/e-table-model.c b/widgets/table/e-table-model.c
index f600c0832d..cef8846049 100644
--- a/widgets/table/e-table-model.c
+++ b/widgets/table/e-table-model.c
@@ -284,7 +284,7 @@ e_table_model_class_init (GObjectClass *object_class)
e_table_model_signals [MODEL_NO_CHANGE] =
g_signal_new ("model_no_change",
- E_OBJECT_CLASS_TYPE (object_class),
+ G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ETableModelClass, model_no_change),
(GSignalAccumulator) NULL, NULL,
@@ -294,7 +294,7 @@ e_table_model_class_init (GObjectClass *object_class)
e_table_model_signals [MODEL_CHANGED] =
g_signal_new ("model_changed",
- E_OBJECT_CLASS_TYPE (object_class),
+ G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ETableModelClass, model_changed),
(GSignalAccumulator) NULL, NULL,
@@ -303,7 +303,7 @@ e_table_model_class_init (GObjectClass *object_class)
e_table_model_signals [MODEL_PRE_CHANGE] =
g_signal_new ("model_pre_change",
- E_OBJECT_CLASS_TYPE (object_class),
+ G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ETableModelClass, model_pre_change),
(GSignalAccumulator) NULL, NULL,
@@ -312,7 +312,7 @@ e_table_model_class_init (GObjectClass *object_class)
e_table_model_signals [MODEL_ROW_CHANGED] =
g_signal_new ("model_row_changed",
- E_OBJECT_CLASS_TYPE (object_class),
+ G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ETableModelClass, model_row_changed),
(GSignalAccumulator) NULL, NULL,
@@ -321,7 +321,7 @@ e_table_model_class_init (GObjectClass *object_class)
e_table_model_signals [MODEL_CELL_CHANGED] =
g_signal_new ("model_cell_changed",
- E_OBJECT_CLASS_TYPE (object_class),
+ G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ETableModelClass, model_cell_changed),
(GSignalAccumulator) NULL, NULL,
@@ -330,7 +330,7 @@ e_table_model_class_init (GObjectClass *object_class)
e_table_model_signals [MODEL_ROWS_INSERTED] =
g_signal_new ("model_rows_inserted",
- E_OBJECT_CLASS_TYPE (object_class),
+ G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ETableModelClass, model_rows_inserted),
(GSignalAccumulator) NULL, NULL,
@@ -339,7 +339,7 @@ e_table_model_class_init (GObjectClass *object_class)
e_table_model_signals [MODEL_ROWS_DELETED] =
g_signal_new ("model_rows_deleted",
- E_OBJECT_CLASS_TYPE (object_class),
+ G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ETableModelClass, model_rows_deleted),
(GSignalAccumulator) NULL, NULL,
diff --git a/widgets/table/e-table-search.c b/widgets/table/e-table-search.c
index 898b179d16..0f014c1a76 100644
--- a/widgets/table/e-table-search.c
+++ b/widgets/table/e-table-search.c
@@ -127,7 +127,7 @@ e_table_search_class_init (GObjectClass *object_class)
e_table_search_signals [SEARCH_SEARCH] =
g_signal_new ("search",
- E_OBJECT_CLASS_TYPE (object_class),
+ G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ETableSearchClass, search),
(GSignalAccumulator) NULL, NULL,
@@ -136,7 +136,7 @@ e_table_search_class_init (GObjectClass *object_class)
e_table_search_signals [SEARCH_ACCEPT] =
g_signal_new ("accept",
- E_OBJECT_CLASS_TYPE (object_class),
+ G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ETableSearchClass, accept),
(GSignalAccumulator) NULL, NULL,
diff --git a/widgets/table/e-table-size-test.c b/widgets/table/e-table-size-test.c
index 07810d4893..308ad484b9 100644
--- a/widgets/table/e-table-size-test.c
+++ b/widgets/table/e-table-size-test.c
@@ -281,7 +281,7 @@ create_table (void)
gtk_container_add (GTK_CONTAINER (window), frame);
/* Size the initial window. */
- gtk_widget_set_usize (window, 300, 200);
+ gtk_widget_set_size_request (window, 300, 200);
/* Show it all. */
gtk_widget_show_all (window);
diff --git a/widgets/table/e-table-sort-info.c b/widgets/table/e-table-sort-info.c
index 5bbf443b76..cfc5f05e1c 100644
--- a/widgets/table/e-table-sort-info.c
+++ b/widgets/table/e-table-sort-info.c
@@ -82,7 +82,7 @@ e_table_sort_info_class_init (ETableSortInfoClass *klass)
e_table_sort_info_signals [SORT_INFO_CHANGED] =
g_signal_new ("sort_info_changed",
- E_OBJECT_CLASS_TYPE (object_class),
+ G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ETableSortInfoClass, sort_info_changed),
(GSignalAccumulator) NULL, NULL,
@@ -91,7 +91,7 @@ e_table_sort_info_class_init (ETableSortInfoClass *klass)
e_table_sort_info_signals [GROUP_INFO_CHANGED] =
g_signal_new ("group_info_changed",
- E_OBJECT_CLASS_TYPE (object_class),
+ G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ETableSortInfoClass, group_info_changed),
(GSignalAccumulator) NULL, NULL,
diff --git a/widgets/table/e-table-sorting-utils.c b/widgets/table/e-table-sorting-utils.c
index 7ac671fd84..7b3f078654 100644
--- a/widgets/table/e-table-sorting-utils.c
+++ b/widgets/table/e-table-sorting-utils.c
@@ -142,7 +142,8 @@ e_table_sorting_utils_sort(ETableModel *source, ETableSortInfo *sort_info, ETabl
closure.ascending[j] = column.ascending;
}
- e_sort(map_table, rows, sizeof(int), e_sort_callback, &closure);
+ g_qsort_with_data (
+ map_table, rows, sizeof(int), e_sort_callback, &closure);
g_free(closure.vals);
g_free(closure.ascending);
@@ -295,7 +296,8 @@ e_table_sorting_utils_tree_sort(ETreeModel *source, ETableSortInfo *sort_info, E
map[i] = i;
}
- e_sort(map, count, sizeof(int), e_sort_callback, &closure);
+ g_qsort_with_data (
+ map, count, sizeof(int), e_sort_callback, &closure);
map_copy = g_new(ETreePath, count);
for (i = 0; i < count; i++) {
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c
index b42d860779..4a3e8efccc 100644
--- a/widgets/table/e-table.c
+++ b/widgets/table/e-table.c
@@ -621,8 +621,10 @@ header_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETable *e_
header is correct */
if (GTK_WIDGET (e_table->header_canvas)->allocation.height !=
E_TABLE_HEADER_ITEM (e_table->header_item)->height)
- gtk_widget_set_usize (GTK_WIDGET (e_table->header_canvas), -2,
- E_TABLE_HEADER_ITEM (e_table->header_item)->height);
+ g_object_set (
+ e_table->header_canvas, "height-request",
+ E_TABLE_HEADER_ITEM (e_table->header_item)->height,
+ NULL);
}
static void
@@ -674,8 +676,9 @@ e_table_setup_header (ETable *e_table)
G_OBJECT (e_table->header_canvas), "size_allocate",
G_CALLBACK (header_canvas_size_allocate), e_table);
- gtk_widget_set_usize (GTK_WIDGET (e_table->header_canvas), -2,
- E_TABLE_HEADER_ITEM (e_table->header_item)->height);
+ g_object_set (
+ e_table->header_canvas, "height-request",
+ E_TABLE_HEADER_ITEM (e_table->header_item)->height, NULL);
}
static gboolean
diff --git a/widgets/table/e-tree-memory.c b/widgets/table/e-tree-memory.c
index 7de48802fd..b24aef5e72 100644
--- a/widgets/table/e-tree-memory.c
+++ b/widgets/table/e-tree-memory.c
@@ -357,7 +357,7 @@ e_tree_memory_class_init (ETreeMemoryClass *klass)
signals [FILL_IN_CHILDREN] =
g_signal_new ("fill_in_children",
- E_OBJECT_CLASS_TYPE (object_class),
+ G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ETreeMemoryClass, fill_in_children),
(GSignalAccumulator) NULL, NULL,
@@ -679,7 +679,9 @@ e_tree_memory_sort_node (ETreeMemory *etmm,
mac.closure = user_data;
mac.callback = callback;
- e_sort (children, count, sizeof (ETreeMemoryPath *), sort_callback, &mac);
+ g_qsort_with_data (
+ children, count, sizeof (ETreeMemoryPath *),
+ sort_callback, &mac);
path->first_child = NULL;
last = NULL;
diff --git a/widgets/table/e-tree-model.c b/widgets/table/e-tree-model.c
index af88c0e3cb..976d3f85b9 100644
--- a/widgets/table/e-tree-model.c
+++ b/widgets/table/e-tree-model.c
@@ -69,7 +69,7 @@ e_tree_model_class_init (GObjectClass *klass)
e_tree_model_signals [PRE_CHANGE] =
g_signal_new ("pre_change",
- E_OBJECT_CLASS_TYPE (klass),
+ G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ETreeModelClass, pre_change),
(GSignalAccumulator) NULL, NULL,
@@ -78,7 +78,7 @@ e_tree_model_class_init (GObjectClass *klass)
e_tree_model_signals [NO_CHANGE] =
g_signal_new ("no_change",
- E_OBJECT_CLASS_TYPE (klass),
+ G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ETreeModelClass, no_change),
(GSignalAccumulator) NULL, NULL,
@@ -87,7 +87,7 @@ e_tree_model_class_init (GObjectClass *klass)
e_tree_model_signals [NODE_CHANGED] =
g_signal_new ("node_changed",
- E_OBJECT_CLASS_TYPE (klass),
+ G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ETreeModelClass, node_changed),
(GSignalAccumulator) NULL, NULL,
@@ -96,7 +96,7 @@ e_tree_model_class_init (GObjectClass *klass)
e_tree_model_signals [NODE_DATA_CHANGED] =
g_signal_new ("node_data_changed",
- E_OBJECT_CLASS_TYPE (klass),
+ G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ETreeModelClass, node_data_changed),
(GSignalAccumulator) NULL, NULL,
@@ -105,7 +105,7 @@ e_tree_model_class_init (GObjectClass *klass)
e_tree_model_signals [NODE_COL_CHANGED] =
g_signal_new ("node_col_changed",
- E_OBJECT_CLASS_TYPE (klass),
+ G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ETreeModelClass, node_col_changed),
(GSignalAccumulator) NULL, NULL,
@@ -114,7 +114,7 @@ e_tree_model_class_init (GObjectClass *klass)
e_tree_model_signals [NODE_INSERTED] =
g_signal_new ("node_inserted",
- E_OBJECT_CLASS_TYPE (klass),
+ G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ETreeModelClass, node_inserted),
(GSignalAccumulator) NULL, NULL,
@@ -123,7 +123,7 @@ e_tree_model_class_init (GObjectClass *klass)
e_tree_model_signals [NODE_REMOVED] =
g_signal_new ("node_removed",
- E_OBJECT_CLASS_TYPE (klass),
+ G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ETreeModelClass, node_removed),
(GSignalAccumulator) NULL, NULL,
@@ -132,7 +132,7 @@ e_tree_model_class_init (GObjectClass *klass)
e_tree_model_signals [NODE_DELETED] =
g_signal_new ("node_deleted",
- E_OBJECT_CLASS_TYPE (klass),
+ G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ETreeModelClass, node_deleted),
(GSignalAccumulator) NULL, NULL,
@@ -141,7 +141,7 @@ e_tree_model_class_init (GObjectClass *klass)
e_tree_model_signals [NODE_REQUEST_COLLAPSE] =
g_signal_new ("node_request_collapse",
- E_OBJECT_CLASS_TYPE (klass),
+ G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ETreeModelClass, node_request_collapse),
(GSignalAccumulator) NULL, NULL,
diff --git a/widgets/table/e-tree-sorted.c b/widgets/table/e-tree-sorted.c
index b5c67dc906..39e3a1cdfb 100644
--- a/widgets/table/e-tree-sorted.c
+++ b/widgets/table/e-tree-sorted.c
@@ -1196,7 +1196,7 @@ e_tree_sorted_class_init (ETreeSortedClass *klass)
signals [NODE_RESORTED] =
g_signal_new ("node_resorted",
- E_OBJECT_CLASS_TYPE (object_class),
+ G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ETreeSortedClass, node_resorted),
(GSignalAccumulator) NULL, NULL,
diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c
index f6679e59b3..6445cd14e8 100644
--- a/widgets/table/e-tree.c
+++ b/widgets/table/e-tree.c
@@ -387,7 +387,10 @@ et_dispose (GObject *object)
scroll_off (et);
hover_off (et);
- e_free_string_list (et->priv->expanded_list);
+ g_list_foreach (
+ et->priv->expanded_list,
+ (GFunc) g_free, NULL);
+ g_list_free (et->priv->expanded_list);
et_disconnect_from_etta (et);
@@ -674,7 +677,7 @@ header_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETree *e_t
header is correct */
if (GTK_WIDGET (e_tree->priv->header_canvas)->allocation.height !=
E_TABLE_HEADER_ITEM (e_tree->priv->header_item)->height)
- gtk_widget_set_usize (GTK_WIDGET (e_tree->priv->header_canvas), -1,
+ gtk_widget_set_size_request (GTK_WIDGET (e_tree->priv->header_canvas), -1,
E_TABLE_HEADER_ITEM (e_tree->priv->header_item)->height);
}
@@ -705,8 +708,9 @@ e_tree_setup_header (ETree *e_tree)
e_tree->priv->header_canvas, "size_allocate",
G_CALLBACK (header_canvas_size_allocate), e_tree);
- gtk_widget_set_usize (GTK_WIDGET (e_tree->priv->header_canvas), -1,
- E_TABLE_HEADER_ITEM (e_tree->priv->header_item)->height);
+ gtk_widget_set_size_request (
+ GTK_WIDGET (e_tree->priv->header_canvas), -1,
+ E_TABLE_HEADER_ITEM (e_tree->priv->header_item)->height);
}
static gboolean
diff --git a/widgets/table/test-table.c b/widgets/table/test-table.c
index a33ecc3c15..3eb42e42a7 100644
--- a/widgets/table/test-table.c
+++ b/widgets/table/test-table.c
@@ -446,7 +446,7 @@ compare=\"string\"/>\n", i, column_labels[i]);
gtk_box_pack_start (GTK_BOX (vbox), bhide, FALSE, FALSE, 0);
#endif
- gtk_widget_set_usize (window, 400, 200);
+ gtk_widget_set_size_request (window, 400, 200);
gtk_widget_show_all (window);
#ifdef BIT_ROT