From 71c5738707028d12a3129a94a1b3823a7fab573c Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 30 Apr 2009 23:30:00 -0400 Subject: Only #include specific libgnome[ui] headers; easier to track. Stop including top-level libgnome[ui] headers -- , and . Instead, include specific header files so we can track them easier. Also, remove several unshipped test programs. Mostly ETable stuff. --- widgets/table/e-table-group-container.c | 3 +- widgets/table/e-table-size-test.c | 306 -------------------- widgets/table/table-test.c | 65 ----- widgets/table/test-check.c | 225 --------------- widgets/table/test-cols.c | 269 ------------------ widgets/table/test-table.c | 479 -------------------------------- 6 files changed, 1 insertion(+), 1346 deletions(-) delete mode 100644 widgets/table/e-table-size-test.c delete mode 100644 widgets/table/table-test.c delete mode 100644 widgets/table/test-check.c delete mode 100644 widgets/table/test-cols.c delete mode 100644 widgets/table/test-table.c (limited to 'widgets/table') diff --git a/widgets/table/e-table-group-container.c b/widgets/table/e-table-group-container.c index 592cd1eee5..c342c6ca7e 100644 --- a/widgets/table/e-table-group-container.c +++ b/widgets/table/e-table-group-container.c @@ -22,9 +22,8 @@ #include -#include #include -#include +#include #include #include "text/e-text.h" diff --git a/widgets/table/e-table-size-test.c b/widgets/table/e-table-size-test.c deleted file mode 100644 index 817785076e..0000000000 --- a/widgets/table/e-table-size-test.c +++ /dev/null @@ -1,306 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see - * - * - * Authors: - * Chris Lahey - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#include -#include -#include -#include -#include "gal/e-util/e-cursors.h" -#include "e-table-simple.h" -#include "e-table-header.h" -#include "e-table-header-item.h" -#include "e-table-item.h" -#include "e-cell-text.h" -#include "e-cell-checkbox.h" -#include "e-table.h" - -#include "table-test.h" - -/* - * One way in which we make it simpler to build an ETableModel is through - * the ETableSimple class. Instead of creating your own ETableModel - * class, you simply create a new object of the ETableSimple class. You - * give it a bunch of functions that act as callbacks. - * - * You also get to pass a void * to ETableSimple and it gets passed to - * your callbacks. This would be for having multiple models of the same - * type. This is just an example though, so we statically define all the - * data and ignore the void *data parameter. - * - * In our example we will be creating a table model with 6 columns and 10 - * rows. This corresponds to having 6 different types of information and - * 10 different sets of data in our database. - * - * The headers will be hard coded, as will be the example data. - * - */ - -/* - * There are two different meanings to the word "column". The first is - * the model column. A model column corresponds to a specific type of - * data. This is very much like the usage in a database table where a - * column is a field in the database. - * - * The second type of column is a view column. A view column - * corresponds to a visually displayed column. Each view column - * corresponds to a specific model column, though a model column may - * have any number of view columns associated with it, from zero to - * greater than one. - * - * Also, a view column doesn't necessarily depend on only one model - * column. In some cases, the view column renderer can be given a - * reference to another column to get extra information about its - * display. -*/ - -#define ROWS 5000 -#define COLS 4 - -#define IMPORTANCE_COLUMN 4 -#define COLOR_COLUMN 5 - -/* - * Here we define the initial layout of the table. This is an xml - * format that allows you to change the initial ordering of the - * columns or to do sorting or grouping initially. This specification - * shows all 5 columns, but moves the importance column nearer to the - * front. It also sorts by the "Full Name" column (ascending.) - * Sorting and grouping take the model column as their arguments - * (sorting is specified by the "column" argument to the leaf elemnt. - */ - -#define INITIAL_SPEC " \ - \ - 0 \ - 4 \ - 1 \ - 2 \ - 3 \ - \ - \ -" - -char *headers [COLS] = { - "Email", - "Full Name", - "Address", - "Phone" -}; - -/* - * Virtual Column list: - * 0 Email - * 1 Full Name - * 2 Address - * 3 Phone - */ - -/* - * ETableSimple callbacks - * These are the callbacks that define the behavior of our custom model. - */ - -/* - * Since our model is a constant size, we can just return its size in - * the column and row count fields. - */ - -/* This function returns the number of columns in our ETableModel. */ -static int -my_col_count (ETableModel *etc, void *data) -{ - return COLS; -} - -/* This function returns the number of rows in our ETableModel. */ -static int -my_row_count (ETableModel *etc, void *data) -{ - return ROWS; -} - -/* This function returns the value at a particular point in our ETableModel. */ -static void * -my_value_at (ETableModel *etc, int col, int row, void *data) -{ - static guchar t[] = {'A', 0xc3, 0x84, 0xc3, 0x95, 0xc3, 0x94, 0xc3, 0xb5, 0x00}; - -#if 0 - if (col == 1) return "toshok@ximian.com"; -#else - if (col == 1) return t; -#endif - else if (col == 2) return "Chris Toshok"; - else if (col == 3) return "43 Vicksburg, SF"; - else if (col == 4) return "415-867-5309"; - else return NULL; -} - -/* This function sets the value at a particular point in our ETableModel. */ -static void -my_set_value_at (ETableModel *etc, int col, int row, const void *val, void *data) -{ -} - -/* This function returns whether a particular cell is editable. */ -static gboolean -my_is_cell_editable (ETableModel *etc, int col, int row, void *data) -{ - return FALSE; -} - -/* This function duplicates the value passed to it. */ -static void * -my_duplicate_value (ETableModel *etc, int col, const void *value, void *data) -{ - return g_strdup (value); -} - -/* This function frees the value passed to it. */ -static void -my_free_value (ETableModel *etc, int col, void *value, void *data) -{ - g_free (value); -} - -/* This function creates an empty value. */ -static void * -my_initialize_value (ETableModel *etc, int col, void *data) -{ - return g_strdup (""); -} - -/* This function reports if a value is empty. */ -static gboolean -my_value_is_empty (ETableModel *etc, int col, const void *value, void *data) -{ - return !(value && *(char *)value); -} - -/* This function reports if a value is empty. */ -static char * -my_value_to_string (ETableModel *etc, int col, const void *value, void *data) -{ - return g_strdup(value); -} - -/* We create a window containing our new table. */ -static void -create_table (void) -{ - GtkWidget *e_table, *window, *frame; - ECell *cell_left_just; - ETableHeader *e_table_header; - ETableModel *e_table_model = NULL; - int i; - - /* Next we create our model. This uses the functions we defined - earlier. */ - e_table_model = e_table_simple_new ( - my_col_count, my_row_count, my_value_at, - my_set_value_at, my_is_cell_editable, - my_duplicate_value, my_free_value, - my_initialize_value, my_value_is_empty, - my_value_to_string, - NULL); - /* - * Next we create a header. The ETableHeader is used in two - * different way. The first is the full_header. This is the - * list of possible columns in the view. The second use is - * completely internal. Many of the ETableHeader functions are - * for that purpose. The only functions we really need are - * e_table_header_new and e_table_header_add_col. - * - * First we create the header. - */ - e_table_header = e_table_header_new (); - - /* - * Next we have to build renderers for all of the columns. - * Since all our columns are text columns, we can simply use - * the same renderer over and over again. If we had different - * types of columns, we could use a different renderer for - * each column. - */ - cell_left_just = e_cell_text_new (e_table_model, NULL, GTK_JUSTIFY_LEFT); - - /* - * Next we create a column object for each view column and add - * them to the header. We don't create a column object for - * the importance column since it will not be shown. - */ - for (i = 0; i < COLS; i++) { - /* Create the column. */ - ETableCol *ecol = e_table_col_new ( - i, headers [i], - 1.0, 20, cell_left_just, - e_str_compare, TRUE); - /* Add it to the header. */ - e_table_header_add_column (e_table_header, ecol, i); - } - - /* - * Here we create a window for our new table. This window - * will get shown and the person will be able to test their - * item. - */ - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - - /* This frame is simply to get a bevel around our table. */ - frame = gtk_frame_new (NULL); - - /* - * Here we create the table. We give it the three pieces of - * the table we've created, the header, the model, and the - * initial layout. It does the rest. - */ - e_table = e_table_new (e_table_header, e_table_model, INITIAL_SPEC); - - /* Build the gtk widget hierarchy. */ - gtk_container_add (GTK_CONTAINER (frame), e_table); - gtk_container_add (GTK_CONTAINER (window), frame); - - /* Size the initial window. */ - gtk_widget_set_size_request (window, 300, 200); - - /* Show it all. */ - gtk_widget_show_all (window); -} - -/* This is the main function which just initializes gnome and call our create_table function */ - -int -main (int argc, char *argv []) -{ - gnome_init ("TableExample", "TableExample", argc, argv); - e_cursors_init (); - - gtk_widget_push_colormap (gdk_rgb_get_colormap ()); - - create_table (); - - gtk_main (); - - e_cursors_shutdown (); - return 0; -} - diff --git a/widgets/table/table-test.c b/widgets/table/table-test.c deleted file mode 100644 index 3f42c86743..0000000000 --- a/widgets/table/table-test.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see - * - * - * Authors: - * Miguel de Icaza - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#include - -#include -#include -#include - -#include - -#include "misc/e-cursors.h" - -#include "table-test.h" - -int -main (int argc, char *argv []) -{ - - if (isatty (0)){ - int fd; - - close (0); - fd = open ("sample.table", O_RDONLY); - if (fd == -1){ - fprintf (stderr, "Could not find sample.table, try feeding a table on stdin"); - exit (1); - } - dup2 (fd, 0); - } - - gnome_init ("TableTest", "TableTest", argc, argv); - e_cursors_init (); - - -/* table_browser_test (); */ -/* multi_cols_test (); */ -/* check_test (); */ - - e_table_test (); - - gtk_main (); - - e_cursors_shutdown (); - return 0; -} diff --git a/widgets/table/test-check.c b/widgets/table/test-check.c deleted file mode 100644 index 86561d3362..0000000000 --- a/widgets/table/test-check.c +++ /dev/null @@ -1,225 +0,0 @@ -/* - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see - * - * - * Authors: - * Miguel de Icaza (miguel@gnu.org) - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#include - -#include -#include - -#include - -#include "misc/e-cursors.h" -#include "misc/e-canvas-utils.h" -#include "misc/e-canvas.h" -#include "e-util/e-util.h" - -#include "e-table-simple.h" -#include "e-table-header.h" -#include "e-table-header-item.h" -#include "e-table-item.h" -#include "e-cell-text.h" -#include "e-cell-checkbox.h" - -#include "table-test.h" - -#define LINES 4 - -static struct { - int value; - char *string; -} my_table [LINES] = { - { 0, "Buy food" }, - { 1, "Breathe " }, - { 0, "Cancel gdb session with shrink" }, - { 1, "Make screenshots" }, -}; -/* - * ETableSimple callbacks - */ -static int -col_count (ETableModel *etc, void *data) -{ - return 2; -} - -static int -row_count (ETableModel *etc, void *data) -{ - return LINES; -} - -static void * -value_at (ETableModel *etc, int col, int row, void *data) -{ - g_assert (col < 2); - g_assert (row < LINES); - - if (col == 0) - return GINT_TO_POINTER (my_table [row].value); - else - return my_table [row].string; - -} - -static void -set_value_at (ETableModel *etc, int col, int row, const void *val, void *data) -{ - g_assert (col < 2); - g_assert (row < LINES); - - if (col == 0) { - my_table [row].value = GPOINTER_TO_INT (val); - printf ("Value at %d,%d set to %d\n", col, row, GPOINTER_TO_INT (val)); - } else { - my_table [row].string = g_strdup (val); - printf ("Value at %d,%d set to %s\n", col, row, (char *) val); - } -} - -static gboolean -is_cell_editable (ETableModel *etc, int col, int row, void *data) -{ - return TRUE; -} - -static void * -duplicate_value (ETableModel *etc, int col, const void *value, void *data) -{ - if (col == 0) { - return (void *) value; - } else { - return g_strdup (value); - } -} - -static void -free_value (ETableModel *etc, int col, void *value, void *data) -{ - if (col != 0) { - g_free (value); - } -} - -static void * -initialize_value (ETableModel *etc, int col, void *data) -{ - if (col == 0) - return NULL; - else - return g_strdup (""); -} - -static gboolean -value_is_empty (ETableModel *etc, int col, const void *value, void *data) -{ - if (col == 0) - return value == NULL; - else - return !(value && *(char *)value); -} - -static char * -value_to_string (ETableModel *etc, int col, const void *value, void *data) -{ - if (col == 0) - return g_strdup_printf("%d", (int) value); - else - return g_strdup(value); -} - -static void -set_canvas_size (GnomeCanvas *canvas, GtkAllocation *alloc) -{ - gnome_canvas_set_scroll_region (canvas, 0, 0, alloc->width, alloc->height); -} - -void -check_test (void) -{ - GtkWidget *canvas, *window; - ETableModel *e_table_model; - ETableHeader *e_table_header; - ETableCol *col_0, *col_1; - ECell *cell_left_just, *cell_image_check; - GdkPixbuf *pixbuf; - GnomeCanvasItem *item; - - gtk_widget_push_colormap (gdk_rgb_get_colormap ()); - - e_table_model = e_table_simple_new ( - col_count, row_count, value_at, - set_value_at, is_cell_editable, - duplicate_value, free_value, - initialize_value, value_is_empty, - value_to_string, - NULL); - - /* - * Header - */ - e_table_header = e_table_header_new (); - - cell_left_just = e_cell_text_new (e_table_model, NULL, GTK_JUSTIFY_LEFT); - - cell_image_check = e_cell_checkbox_new (); - pixbuf = gdk_pixbuf_new_from_file ("clip.png"); - col_0 = e_table_col_new_with_pixbuf (0, pixbuf, 0.0, 18, cell_image_check, e_int_compare, TRUE); - g_object_unref (pixbuf); - e_table_header_add_column (e_table_header, col_0, 0); - - col_1 = e_table_col_new (1, "Item Name", 1.0, 20, cell_left_just, e_str_compare, TRUE); - e_table_header_add_column (e_table_header, col_1, 1); - e_table_col_set_arrow (col_1, E_TABLE_COL_ARROW_DOWN); - - /* - * GUI - */ - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - canvas = e_canvas_new (); - - g_signal_connect (canvas, "size_allocate", - G_CALLBACK (set_canvas_size), NULL); - - gtk_container_add (GTK_CONTAINER (window), canvas); - gtk_widget_show_all (window); - gnome_canvas_item_new ( - gnome_canvas_root (GNOME_CANVAS (canvas)), - e_table_header_item_get_type (), - "ETableHeader", e_table_header, - NULL); - - item = gnome_canvas_item_new ( - gnome_canvas_root (GNOME_CANVAS (canvas)), - e_table_item_get_type (), - "ETableHeader", e_table_header, - "ETableModel", e_table_model, - "drawgrid", TRUE, - "drawfocus", TRUE, -#if 0 - "spreadsheet", TRUE, -#endif - "cursor_mode", E_TABLE_CURSOR_SIMPLE, - NULL); - e_canvas_item_move_absolute (item, 0, 30); -} - diff --git a/widgets/table/test-cols.c b/widgets/table/test-cols.c deleted file mode 100644 index 7c3ac25705..0000000000 --- a/widgets/table/test-cols.c +++ /dev/null @@ -1,269 +0,0 @@ -/* - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see - * - * - * Authors: - * Miguel de Icaza (miguel@gnu.org) - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#include - -#include -#include - -#include - -#include "misc/e-canvas-utils.h" -#include "misc/e-canvas.h" -#include "misc/e-cursors.h" -#include "e-util/e-util.h" - -#include "e-table-simple.h" -#include "e-table-header.h" -#include "e-table-header-item.h" -#include "e-table-item.h" -#include "e-cell-text.h" -#include "e-cell-toggle.h" - -#include "table-test.h" - -#define LINES 4 - -static struct { - int value; - char *string; -} my_table [LINES] = { - { 0, "You are not" }, - { 1, "A beautiful and unique " }, - { 0, "Snowflake" }, - { 2, "You are not your wallet" }, -}; -/* - * ETableSimple callbacks - */ -static int -col_count (ETableModel *etc, void *data) -{ - return 2; -} - -static int -row_count (ETableModel *etc, void *data) -{ - return LINES; -} - -static void * -value_at (ETableModel *etc, int col, int row, void *data) -{ - g_assert (col < 2); - g_assert (row < LINES); - - if (col == 0) - return GINT_TO_POINTER (my_table [row].value); - else - return my_table [row].string; - -} - -static void -set_value_at (ETableModel *etc, int col, int row, const void *val, void *data) -{ - g_assert (col < 2); - g_assert (row < LINES); - - if (col == 0){ - my_table [row].value = GPOINTER_TO_INT (val); - printf ("Value at %d,%d set to %d\n", col, row, GPOINTER_TO_INT (val)); - } else { - my_table [row].string = g_strdup (val); - printf ("Value at %d,%d set to %s\n", col, row, (char *) val); - } -} - -static gboolean -is_cell_editable (ETableModel *etc, int col, int row, void *data) -{ - return TRUE; -} - -static void * -duplicate_value (ETableModel *etc, int col, const void *value, void *data) -{ - if (col == 0){ - return (void *)value; - } else { - return g_strdup (value); - } -} - -static void -free_value (ETableModel *etc, int col, void *value, void *data) -{ - if (col != 0){ - g_free (value); - } -} - -static void * -initialize_value (ETableModel *etc, int col, void *data) -{ - if (col == 0) - return NULL; - else - return g_strdup (""); -} - -static gboolean -value_is_empty (ETableModel *etc, int col, const void *value, void *data) -{ - if (col == 0) - return value == NULL; - else - return !(value && *(char *)value); -} - -static char * -value_to_string (ETableModel *etc, int col, const void *value, void *data) -{ - if (col == 0) - return g_strdup_printf("%d", (int) value); - else - return g_strdup(value); -} - -static void -set_canvas_size (GnomeCanvas *canvas, GtkAllocation *alloc) -{ - gnome_canvas_set_scroll_region (canvas, 0, 0, alloc->width, alloc->height); -} - -void -multi_cols_test (void) -{ - GtkWidget *canvas, *window; - ETableModel *e_table_model; - ETableHeader *e_table_header, *e_table_header_multiple; - ETableCol *col_0, *col_1; - ECell *cell_left_just, *cell_image_toggle; - GnomeCanvasItem *item; - - gtk_widget_push_colormap (gdk_rgb_get_colormap ()); - - e_table_model = e_table_simple_new ( - col_count, row_count, value_at, - set_value_at, is_cell_editable, - duplicate_value, free_value, - initialize_value, value_is_empty, - value_to_string, - NULL); - - /* - * Header - */ - e_table_header = e_table_header_new (); - - cell_left_just = e_cell_text_new (e_table_model, NULL, GTK_JUSTIFY_LEFT); - - { - GdkPixbuf **images = g_new (GdkPixbuf *, 3); - int i; - - images [0] = gdk_pixbuf_new_from_file ("image1.png"); - images [1] = gdk_pixbuf_new_from_file ("image2.png"); - images [2] = gdk_pixbuf_new_from_file ("image3.png"); - - cell_image_toggle = e_cell_toggle_new (0, 3, images); - - for (i = 0; i < 3; i++) - g_object_unref (images [i]); - - g_free (images); - } - - col_1 = e_table_col_new (1, "Item Name", 1.0, 20, cell_left_just, e_str_compare, TRUE); - e_table_header_add_column (e_table_header, col_1, 0); - - col_0 = e_table_col_new (0, "A", 0.0, 48, cell_image_toggle, e_int_compare, TRUE); - e_table_header_add_column (e_table_header, col_0, 1); - - /* - * Second test - */ - e_table_header_multiple = e_table_header_new (); - e_table_header_add_column (e_table_header_multiple, col_0, 0); - e_table_header_add_column (e_table_header_multiple, col_1, 1); - e_table_header_add_column (e_table_header_multiple, col_1, 2); - - /* - * GUI - */ - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - canvas = e_canvas_new (); - - g_signal_connect (canvas, "size_allocate", - G_CALLBACK (set_canvas_size), NULL); - - gtk_container_add (GTK_CONTAINER (window), canvas); - gtk_widget_show_all (window); - - gnome_canvas_item_new ( - gnome_canvas_root (GNOME_CANVAS (canvas)), - e_table_header_item_get_type (), - "ETableHeader", e_table_header, - NULL); - - item = gnome_canvas_item_new ( - gnome_canvas_root (GNOME_CANVAS (canvas)), - e_table_item_get_type (), - "ETableHeader", e_table_header, - "ETableModel", e_table_model, - "drawgrid", TRUE, - "drawfocus", TRUE, - "cursor_mode", E_TABLE_CURSOR_SIMPLE, -#if 0 - "spreadsheet", TRUE, -#endif - NULL); - - e_canvas_item_move_absolute (item, 0, 30); - - gnome_canvas_item_new ( - gnome_canvas_root (GNOME_CANVAS (canvas)), - e_table_header_item_get_type (), - "ETableHeader", e_table_header_multiple, - NULL); - item = gnome_canvas_item_new ( - gnome_canvas_root (GNOME_CANVAS (canvas)), - e_table_item_get_type (), - "ETableHeader", e_table_header_multiple, - "ETableModel", e_table_model, - "drawgrid", TRUE, - "drawfocus", TRUE, -#if 0 - "spreadsheet", TRUE, -#endif - "cursor_mode", E_TABLE_CURSOR_SIMPLE, - NULL); - e_canvas_item_move_absolute (item, 300, 30); -} - - - - - diff --git a/widgets/table/test-table.c b/widgets/table/test-table.c deleted file mode 100644 index 5d6c99e1d3..0000000000 --- a/widgets/table/test-table.c +++ /dev/null @@ -1,479 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see - * - * - * Authors: - * Miguel de Icaza - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#include - -#include -#include - -#include - -#include "misc/e-cursors.h" -#include "misc/e-canvas.h" - -#include "e-table-simple.h" -#include "e-table-header.h" -#include "e-table-header-item.h" -#include "e-table-item.h" -#include "e-cell-text.h" -#include "e-table.h" -#include "e-table-config.h" - -#include "table-test.h" - -char buffer [1024]; -char **column_labels; -char ***table_data; -int cols = 0; -int lines = 0; -int lines_alloc = 0; - -static void -parse_headers (void) -{ - char *p, *s; - int in_value = 0, i; - - fgets (buffer, sizeof (buffer)-1, stdin); - - for (p = buffer; *p; p++){ - if (*p == ' ' || *p == '\t'){ - if (in_value){ - cols++; - in_value = 0; - } - } else - in_value = 1; - } - if (in_value) - cols++; - - if (!cols){ - fprintf (stderr, "No columns in first row\n"); - exit (1); - } - - column_labels = g_new0 (char *, cols); - - p = buffer; - for (i = 0; (s = strtok (p, " \t")) != NULL; i++){ - column_labels [i] = g_strdup (s); - if (strchr (column_labels [i], '\n')) - *strchr (column_labels [i], '\n') = 0; - p = NULL; - } - - printf ("%d headers:\n", cols); - for (i = 0; i < cols; i++){ - printf ("header %d: %s\n", i, column_labels [i]); - } -} - -static char ** -load_line (char *buffer, int cols) -{ - char **line = g_new0 (char *, cols); - char *p; - int i; - - for (i = 0; i < cols; i++){ - p = strtok (buffer, " \t\n"); - if (p == NULL){ - for (; i < cols; i++) - line [i] = g_strdup (""); - return line; - } else - line [i] = g_strdup (p); - buffer = NULL; - } - return line; -} - -static void -append_line (char **line) -{ - if (lines <= lines_alloc){ - lines_alloc = lines + 50; - table_data = g_renew (char **, table_data, lines_alloc); - } - table_data [lines] = line; - lines++; -} - -static void -load_data (void) -{ - int i; - - { - static int loaded; - - if (loaded) - return; - - loaded = TRUE; - } - - - parse_headers (); - - while (fgets (buffer, sizeof (buffer)-1, stdin) != NULL){ - char **line; - - if (buffer [0] == '\n') - continue; - line = load_line (buffer, cols); - append_line (line); - } - - for (i = 0; i < lines; i++){ - int j; - - printf ("Line %d: ", i); - for (j = 0; j < cols; j++) - printf ("[%s] ", table_data [i][j]); - printf ("\n"); - } -} - -/* - * ETableSimple callbacks - */ -static int -col_count (ETableModel *etc, void *data) -{ - return cols; -} - -static int -row_count (ETableModel *etc, void *data) -{ - return lines; -} - -static void -append_row (ETableModel *etm, ETableModel *model, int row, void *data) -{ - abort (); -} - -static void * -value_at (ETableModel *etc, int col, int row, void *data) -{ - g_assert (col < cols); - g_assert (row < lines); - - fprintf (stderr, "value_at[%d,%d]\n", col, row); - - return (void *) table_data [row][col]; -} - -static void -set_value_at (ETableModel *etc, int col, int row, const void *val, void *data) -{ - g_assert (col < cols); - g_assert (row < lines); - - g_free (table_data [row][col]); - table_data [row][col] = g_strdup (val); - - printf ("Value at %d,%d set to %s\n", col, row, (char *) val); -} - -static gboolean -is_cell_editable (ETableModel *etc, int col, int row, void *data) -{ - return TRUE; -} - -static gboolean -has_save_id (ETableModel *etm, void *data) -{ - return FALSE; -} - -static char * -get_save_id (ETableModel *etm, int row, void *data) -{ - abort (); -} - -static void * -duplicate_value (ETableModel *etc, int col, const void *value, void *data) -{ - return g_strdup (value); -} - -static void -free_value (ETableModel *etc, int col, void *value, void *data) -{ - g_free (value); -} - -static void * -initialize_value (ETableModel *etc, int col, void *data) -{ - return g_strdup (""); -} - -static gboolean -value_is_empty (ETableModel *etc, int col, const void *value, void *data) -{ - return !(value && *(char *)value); -} - -static char * -value_to_string (ETableModel *etc, int col, const void *value, void *data) -{ - return g_strdup(value); -} - -#ifdef BIT_ROT -static void -set_canvas_size (GnomeCanvas *canvas, GtkAllocation *alloc) -{ - gnome_canvas_set_scroll_region (canvas, 0, 0, alloc->width, alloc->height); -} - -void -table_browser_test (void) -{ - GtkWidget *canvas, *window; - ETableModel *e_table_model; - ETableHeader *e_table_header; - ECell *cell_left_just; - GnomeCanvasItem *group; - int i; - int priority = 20; - - load_data (); - - /* - * Data model - */ - e_table_model = e_table_simple_new ( - col_count, row_count, append_row, - - value_at, set_value_at, is_cell_editable, - - has_save_id, get_save_id, - - duplicate_value, free_value, - initialize_value, value_is_empty, - value_to_string, - NULL); - - /* - * Header - */ - e_table_header = e_table_header_new (); - cell_left_just = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - - for (i = 0; i < cols; i++){ - ETableCol *ecol = e_table_col_new ( - i, column_labels [i], - 1.0, 20, cell_left_just, - e_str_compare, TRUE, - priority); - - e_table_header_add_column (e_table_header, ecol, i); - } - - /* - * Setup GUI - */ - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - canvas = e_canvas_new (); - - g_signal_connect (canvas, "size_allocate", - G_CALLBACK (set_canvas_size), NULL); - - gtk_container_add (GTK_CONTAINER (window), canvas); - gtk_widget_show_all (window); - gnome_canvas_item_new ( - gnome_canvas_root (GNOME_CANVAS (canvas)), - e_table_header_item_get_type (), - "ETableHeader", e_table_header, - NULL); - - group = gnome_canvas_item_new ( - gnome_canvas_root (GNOME_CANVAS (canvas)), - gnome_canvas_group_get_type (), - "x", 30.0, - "y", 30.0, - NULL); - - gnome_canvas_item_new ( - GNOME_CANVAS_GROUP (group), - e_table_item_get_type (), - "ETableHeader", e_table_header, - "ETableModel", e_table_model, - "drawgrid", TRUE, - "drawfocus", TRUE, -#if 0 - "spreadsheet", TRUE, -#endif - NULL); -} -#endif - -static void -save_spec (GtkWidget *button, ETable *e_table) -{ -#ifdef BIT_ROT - e_table_save_specification (e_table, "e-table-test.xml"); -#endif -} - -#ifdef BIT_ROT -static void -row_selection_test (ETable *table, int row, gboolean selected) -{ - if (selected) - g_print ("Row %d selected\n", row); - else - g_print ("Row %d unselected\n", row); -} -#endif - -static void -toggle_grid (void *nothing, ETable *etable) -{ - static gboolean shown; - - g_object_get (etable, "drawgrid", &shown, NULL); - g_object_set (etable, "drawgrid", !shown, NULL); -} - -static void -do_e_table_demo (const char *state) -{ - GtkWidget *e_table, *window, *frame, *vbox, *button, *bhide; - ECell *cell_left_just; - ETableHeader *full_header; - int i; - GString *spec; - - /* - * Data model - */ - static ETableModel *e_table_model = NULL; - - if (e_table_model == NULL) - e_table_model = - e_table_simple_new (col_count, row_count, append_row, - value_at, set_value_at, is_cell_editable, - has_save_id, get_save_id, - duplicate_value, free_value, - initialize_value, value_is_empty, - value_to_string, - NULL); - - full_header = e_table_header_new (); - cell_left_just = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - - spec = g_string_new ("\ -"); - for (i = 0; i < cols; i++) { - char *colspec = - g_strdup_printf ("\ - \n", i, column_labels[i]); - g_string_append (spec, colspec); - g_free (colspec); - } - g_string_append (spec, ""); - e_table = e_table_new (e_table_model, NULL, spec->str, state); - - /* This makes value_at not called just to determine row height. */ - g_object_set (e_table, - "uniform_row_height", 1, - NULL); - - g_string_free (spec, TRUE); - - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - frame = gtk_frame_new (NULL); -#ifdef BIT_ROT - g_signal_connect (e_table, "row_selection", - G_CALLBACK(row_selection_test), NULL); -#endif - - vbox = gtk_vbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (vbox), e_table, TRUE, TRUE, 0); - gtk_container_add (GTK_CONTAINER (frame), vbox); - gtk_container_add (GTK_CONTAINER (window), frame); - -#if 0 - /* - * gadgets - */ - button = gtk_button_new_with_label ("Save spec"); - g_signal_connect (button, "clicked", - G_CALLBACK (save_spec), e_table); - gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); - - bhide = gtk_button_new_with_label ("Toggle Grid"); - g_signal_connect (bhide, "clicked", - G_CALLBACk (toggle_grid), e_table); - gtk_box_pack_start (GTK_BOX (vbox), bhide, FALSE, FALSE, 0); -#endif - - gtk_widget_set_size_request (window, 400, 200); - gtk_widget_show_all (window); - -#ifdef BIT_ROT - if (getenv ("TEST")){ - e_table_do_gui_config (NULL, E_TABLE(e_table)); - } -#endif -} - -void -e_table_test (void) -{ - load_data (); - - if (1){/*getenv ("DO")){*/ - do_e_table_demo ("\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); -#if 0 - do_e_table_demo (" 0 0 1 2 3 4 "); - do_e_table_demo (" 0 1 2 3 4 "); - do_e_table_demo (" 0 1 2 3 4 "); -#endif - } -} -- cgit v1.2.3 From d523f10dfe2a6ba53c068189f10055d46e71e10f Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 2 May 2009 11:09:30 -0400 Subject: Use Behdad's brilliant git.mk to generate .gitignore files. --- widgets/table/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) (limited to 'widgets/table') diff --git a/widgets/table/Makefile.am b/widgets/table/Makefile.am index 836a1dd570..0dbe1e6fe3 100644 --- a/widgets/table/Makefile.am +++ b/widgets/table/Makefile.am @@ -164,3 +164,5 @@ icons = \ EXTRA_DIST = \ $(icons) \ $(glade_DATA) + +-include $(top_srcdir)/git.mk -- cgit v1.2.3 From cb94029bdec4c4b885daa6337e6de9ffb1b9eae2 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 2 May 2009 23:22:14 -0400 Subject: =?UTF-8?q?Bug=20325131=20=E2=80=93=20Do=20not=20translate=20ETabl?= =?UTF-8?q?e=20property=20nicknames?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- widgets/table/e-table-field-chooser-dialog.c | 6 +++--- widgets/table/e-table-field-chooser-item.c | 10 +++++----- widgets/table/e-table-field-chooser.c | 6 +++--- widgets/table/e-table-header-item.c | 14 +++++++------- 4 files changed, 18 insertions(+), 18 deletions(-) (limited to 'widgets/table') diff --git a/widgets/table/e-table-field-chooser-dialog.c b/widgets/table/e-table-field-chooser-dialog.c index b958fc27bf..e92428d5f8 100644 --- a/widgets/table/e-table-field-chooser-dialog.c +++ b/widgets/table/e-table-field-chooser-dialog.c @@ -64,21 +64,21 @@ e_table_field_chooser_dialog_class_init (ETableFieldChooserDialogClass *klass) g_object_class_install_property (object_class, PROP_DND_CODE, g_param_spec_string ("dnd_code", - _("DnD code"), + "DnD code", /*_( */"XXX blurb" /*)*/, NULL, G_PARAM_READWRITE)); g_object_class_install_property (object_class, PROP_FULL_HEADER, g_param_spec_object ("full_header", - _("Full Header"), + "Full Header", /*_( */"XXX blurb" /*)*/, E_TABLE_HEADER_TYPE, G_PARAM_READWRITE)); g_object_class_install_property (object_class, PROP_HEADER, g_param_spec_object ("header", - _("Header"), + "Header", /*_( */"XXX blurb" /*)*/, E_TABLE_HEADER_TYPE, G_PARAM_READWRITE)); diff --git a/widgets/table/e-table-field-chooser-item.c b/widgets/table/e-table-field-chooser-item.c index cf781c43d5..d29dcbfa5f 100644 --- a/widgets/table/e-table-field-chooser-item.c +++ b/widgets/table/e-table-field-chooser-item.c @@ -630,35 +630,35 @@ etfci_class_init (ETableFieldChooserItemClass *klass) g_object_class_install_property (object_class, PROP_DND_CODE, g_param_spec_string ("dnd_code", - _("DnD code"), + "DnD code", /*_( */"XXX blurb" /*)*/, NULL, G_PARAM_READWRITE)); g_object_class_install_property (object_class, PROP_FULL_HEADER, g_param_spec_object ("full_header", - _("Full Header"), + "Full Header", /*_( */"XXX blurb" /*)*/, E_TABLE_HEADER_TYPE, G_PARAM_READWRITE)); g_object_class_install_property (object_class, PROP_HEADER, g_param_spec_object ("header", - _("Header"), + "Header", /*_( */"XXX blurb" /*)*/, E_TABLE_HEADER_TYPE, G_PARAM_READWRITE)); g_object_class_install_property (object_class, PROP_WIDTH, g_param_spec_double ("width", - _("Width"), + "Width", /*_( */"XXX blurb" /*)*/, 0, G_MAXDOUBLE, 0, G_PARAM_READWRITE)); g_object_class_install_property (object_class, PROP_HEIGHT, g_param_spec_double ("height", - _("Height"), + "Height", /*_( */"XXX blurb" /*)*/, 0, G_MAXDOUBLE, 0, G_PARAM_READABLE)); diff --git a/widgets/table/e-table-field-chooser.c b/widgets/table/e-table-field-chooser.c index f86cb780ca..2a343e9915 100644 --- a/widgets/table/e-table-field-chooser.c +++ b/widgets/table/e-table-field-chooser.c @@ -63,21 +63,21 @@ e_table_field_chooser_class_init (ETableFieldChooserClass *klass) g_object_class_install_property (object_class, PROP_DND_CODE, g_param_spec_string ("dnd_code", - _("DnD code"), + "DnD code", /*_( */"XXX blurb" /*)*/, NULL, G_PARAM_READWRITE)); g_object_class_install_property (object_class, PROP_FULL_HEADER, g_param_spec_object ("full_header", - _("Full Header"), + "Full Header", /*_( */"XXX blurb" /*)*/, E_TABLE_HEADER_TYPE, G_PARAM_READWRITE)); g_object_class_install_property (object_class, PROP_HEADER, g_param_spec_object ("header", - _("Header"), + "Header", /*_( */"XXX blurb" /*)*/, E_TABLE_HEADER_TYPE, G_PARAM_READWRITE)); diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index 7aa7a92351..e6c20b1796 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -1882,49 +1882,49 @@ ethi_class_init (ETableHeaderItemClass *klass) g_object_class_install_property (object_class, PROP_DND_CODE, g_param_spec_string ("dnd_code", - _("DnD code"), + "DnD code", /*_( */"XXX blurb" /*)*/, NULL, G_PARAM_READWRITE)); g_object_class_install_property (object_class, PROP_TABLE_FONT_DESC, g_param_spec_boxed ("font-desc", - _("Font Description"), + "Font Description", /*_( */"XXX blurb" /*)*/, PANGO_TYPE_FONT_DESCRIPTION, G_PARAM_WRITABLE)); g_object_class_install_property (object_class, PROP_FULL_HEADER, g_param_spec_object ("full_header", - _("Full Header"), + "Full Header", /*_( */"XXX blurb" /*)*/, E_TABLE_HEADER_TYPE, G_PARAM_READWRITE)); g_object_class_install_property (object_class, PROP_TABLE_HEADER, g_param_spec_object ("ETableHeader", - _("Header"), + "Header", /*_( */"XXX blurb" /*)*/, E_TABLE_HEADER_TYPE, G_PARAM_WRITABLE)); g_object_class_install_property (object_class, PROP_SORT_INFO, g_param_spec_object ("sort_info", - _("Sort Info"), + "Sort Info", /*_( */"XXX blurb" /*)*/, E_TABLE_SORT_INFO_TYPE, G_PARAM_WRITABLE)); g_object_class_install_property (object_class, PROP_TABLE, g_param_spec_object ("table", - _("Table"), + "Table", /*_( */"XXX blurb" /*)*/, E_TABLE_TYPE, G_PARAM_WRITABLE)); g_object_class_install_property (object_class, PROP_TREE, g_param_spec_object ("tree", - _("Tree"), + "Tree", /*_( */"XXX blurb" /*)*/, E_TREE_TYPE, G_PARAM_WRITABLE)); -- cgit v1.2.3 From fad86a267fd3c0ebc402ca67f14a0d2f74f57b74 Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Mon, 4 May 2009 09:40:18 +0530 Subject: =?UTF-8?q?**=20BUGFIX:=20569696=20=E2=80=93=20Memory=20leak=20in?= =?UTF-8?q?=20message-list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not exactly a leak, but a build-up over a period of time. Clear the internal gnode on regen. --- widgets/table/e-tree-model.c | 30 ++++++++++++++++++++++++++++++ widgets/table/e-tree-model.h | 2 ++ widgets/table/e-tree-table-adapter.c | 27 +++++++++++++++++++++++++++ 3 files changed, 59 insertions(+) (limited to 'widgets/table') diff --git a/widgets/table/e-tree-model.c b/widgets/table/e-tree-model.c index 10c7afeb54..b2e2d99a75 100644 --- a/widgets/table/e-tree-model.c +++ b/widgets/table/e-tree-model.c @@ -53,6 +53,7 @@ enum { NODE_REMOVED, NODE_DELETED, NODE_REQUEST_COLLAPSE, + REBUILT, LAST_SIGNAL }; @@ -82,6 +83,15 @@ e_tree_model_class_init (ETreeModelClass *klass) g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); + e_tree_model_signals [REBUILT] = + g_signal_new ("rebuilt", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeModelClass, rebuilt), + (GSignalAccumulator) NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + e_tree_model_signals [NODE_CHANGED] = g_signal_new ("node_changed", G_TYPE_FROM_CLASS (object_class), @@ -183,6 +193,7 @@ e_tree_model_class_init (ETreeModelClass *klass) klass->pre_change = NULL; klass->no_change = NULL; + klass->rebuilt = NULL; klass->node_changed = NULL; klass->node_data_changed = NULL; klass->node_col_changed = NULL; @@ -240,6 +251,25 @@ e_tree_model_no_change (ETreeModel *tree_model) g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [NO_CHANGE], 0); } +/** + * e_tree_model_rebuilt: + * @tree_model: + * @node: + * + * + * + * Return value: + **/ +void +e_tree_model_rebuilt (ETreeModel *tree_model) +{ + g_return_if_fail (tree_model != NULL); + g_return_if_fail (E_IS_TREE_MODEL (tree_model)); + + d(g_print("Emitting rebuilt on model 0x%p, a %s.\n", tree_model, g_type_name (GTK_OBJECT(tree_model)->klass->type))); + + g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [REBUILT], 0); +} /** * e_tree_model_node_changed: * @tree_model: diff --git a/widgets/table/e-tree-model.h b/widgets/table/e-tree-model.h index a318bd7df0..96828a8e0a 100644 --- a/widgets/table/e-tree-model.h +++ b/widgets/table/e-tree-model.h @@ -112,6 +112,7 @@ struct ETreeModelClass { void (*node_inserted) (ETreeModel *etm, ETreePath parent, ETreePath inserted_node); void (*node_removed) (ETreeModel *etm, ETreePath parent, ETreePath removed_node, int old_position); void (*node_deleted) (ETreeModel *etm, ETreePath deleted_node); + void (*rebuilt) (ETreeModel *etm); /* This signal requests that any viewers of the tree that * collapse and expand nodes collapse this node. @@ -206,6 +207,7 @@ ETreePath e_tree_model_node_find (ETreeModel *model, */ void e_tree_model_pre_change (ETreeModel *tree_model); void e_tree_model_no_change (ETreeModel *tree_model); +void e_tree_model_rebuilt (ETreeModel *tree_model); void e_tree_model_node_changed (ETreeModel *tree_model, ETreePath node); void e_tree_model_node_data_changed (ETreeModel *tree_model, diff --git a/widgets/table/e-tree-table-adapter.c b/widgets/table/e-tree-table-adapter.c index 7e63a64783..10c29fbf10 100644 --- a/widgets/table/e-tree-table-adapter.c +++ b/widgets/table/e-tree-table-adapter.c @@ -72,6 +72,7 @@ struct ETreeTableAdapterPriv { int pre_change_id; int no_change_id; + int rebuilt_id; int node_changed_id; int node_data_changed_id; int node_col_changed_id; @@ -542,6 +543,8 @@ etta_dispose (GObject *object) etta->priv->pre_change_id); g_signal_handler_disconnect (G_OBJECT (etta->priv->source), etta->priv->no_change_id); + g_signal_handler_disconnect (G_OBJECT (etta->priv->source), + etta->priv->rebuilt_id); g_signal_handler_disconnect (G_OBJECT (etta->priv->source), etta->priv->node_changed_id); g_signal_handler_disconnect (G_OBJECT (etta->priv->source), @@ -730,6 +733,7 @@ etta_init (ETreeTableAdapter *etta) etta->priv->pre_change_id = 0; etta->priv->no_change_id = 0; + etta->priv->rebuilt_id = 0; etta->priv->node_changed_id = 0; etta->priv->node_data_changed_id = 0; etta->priv->node_col_changed_id = 0; @@ -753,6 +757,27 @@ etta_proxy_no_change (ETreeModel *etm, ETreeTableAdapter *etta) e_table_model_no_change(E_TABLE_MODEL(etta)); } +static gboolean +remove_all (gpointer key, gpointer value, gpointer data) +{ + GNode *gn = (GNode *) data; + if (data) + g_free (gn->data); + + return TRUE; +} + +static void +etta_proxy_rebuilt (ETreeModel *etm, ETreeTableAdapter *etta) +{ + if (!etta->priv->root) + return; + kill_gnode (etta->priv->root, etta); + etta->priv->root = NULL; + g_hash_table_destroy (etta->priv->nodes); + etta->priv->nodes = g_hash_table_new(NULL, NULL); +} + static gboolean resort_model (ETreeTableAdapter *etta) { @@ -866,6 +891,8 @@ e_tree_table_adapter_construct (ETreeTableAdapter *etta, ETreeModel *source, ETa G_CALLBACK (etta_proxy_pre_change), etta); etta->priv->no_change_id = g_signal_connect (G_OBJECT (source), "no_change", G_CALLBACK (etta_proxy_no_change), etta); + etta->priv->rebuilt_id = g_signal_connect (G_OBJECT (source), "rebuilt", + G_CALLBACK (etta_proxy_rebuilt), etta); etta->priv->node_changed_id = g_signal_connect (G_OBJECT (source), "node_changed", G_CALLBACK (etta_proxy_node_changed), etta); etta->priv->node_data_changed_id = g_signal_connect (G_OBJECT (source), "node_data_changed", -- cgit v1.2.3 From 6e72a236dcb592a942881e118d6a71888ea1581b Mon Sep 17 00:00:00 2001 From: Marcel Stimberg Date: Mon, 4 May 2009 10:10:55 +0530 Subject: ** BUGFIX: 573830 - g_timeout_add_seconds should be preferred to g_timeout_add According to https://wiki.ubuntu.com/SavingTheWorld (and of course according to the gtk docs) using g_timeout_add_seconds is preferred over g_timeout_add if a timeout in seconds is desired. --- widgets/table/e-table-search.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'widgets/table') diff --git a/widgets/table/e-table-search.c b/widgets/table/e-table-search.c index 7a51b62f1c..307d28de39 100644 --- a/widgets/table/e-table-search.c +++ b/widgets/table/e-table-search.c @@ -100,7 +100,7 @@ static void add_timeout (ETableSearch *ets) { drop_timeout (ets); - ets->priv->timeout_id = g_timeout_add (1000, ets_accept, ets); + ets->priv->timeout_id = g_timeout_add_seconds (1, ets_accept, ets); } static void -- cgit v1.2.3