Commit 7415a642 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

more g_signal-ification.

2002-02-15  Jody Goldberg <jody@gnome.org>

	* src/widgets/gnumeric-combo-text.c (gnm_combo_text_destroy) : more
	  g_signal-ification.

	* src/workbook.c (workbook_set_saveinfo) : use a weak_ref.
parent f84a08c5
2002-02-15 Jody Goldberg <jody@gnome.org>
* src/widgets/gnumeric-combo-text.c (gnm_combo_text_destroy) : more
g_signal-ification.
* src/workbook.c (workbook_set_saveinfo) : use a weak_ref.
2002-02-15 Jody Goldberg <jody@gnome.org>
* src/item-cursor.c (item_cursor_tip_setlabel) : enable now that the
......
2002-02-15 Jody Goldberg <jody@gnome.org>
* src/widgets/gnumeric-combo-text.c (gnm_combo_text_destroy) : more
g_signal-ification.
* src/workbook.c (workbook_set_saveinfo) : use a weak_ref.
2002-02-15 Jody Goldberg <jody@gnome.org>
* src/item-cursor.c (item_cursor_tip_setlabel) : enable now that the
......
2002-02-15 Jody Goldberg <jody@gnome.org>
* src/widgets/gnumeric-combo-text.c (gnm_combo_text_destroy) : more
g_signal-ification.
* src/workbook.c (workbook_set_saveinfo) : use a weak_ref.
2002-02-15 Jody Goldberg <jody@gnome.org>
* src/item-cursor.c (item_cursor_tip_setlabel) : enable now that the
......
......@@ -721,9 +721,8 @@ clist_moveto (GtkCList *clist, gint row)
static void
cb_clist_moveto (GtkWidget *clist, gpointer row)
{
gtk_signal_disconnect_by_func (GTK_OBJECT (clist),
GTK_SIGNAL_FUNC (cb_clist_moveto),
row);
g_signal_handlers_disconnect_by_func (G_OBJECT (clist),
G_CALLBACK (cb_clist_moveto), row);
clist_moveto (GTK_CLIST (clist), GPOINTER_TO_INT (row));
}
......
......@@ -251,7 +251,7 @@ gnm_combo_text_destroy (GtkObject *object)
gtk_signal_disconnect_by_func (GTK_OBJECT (ct),
G_CALLBACK (cb_pop_down), NULL);
gtk_signal_disconnect_by_func (GTK_OBJECT (ct->list),
g_signal_handlers_disconnect_by_func (GTK_OBJECT (ct->list),
G_CALLBACK (cb_list_unselect), ct);
parent = g_type_class_peek (gtk_combo_box_get_type ());
......
......@@ -317,9 +317,9 @@ static void
gee_detach_scg (GnumericExprEntry *gee)
{
if (gee->scg != NULL) {
g_object_weak_unref (G_OBJECT (gee->scg),
(GWeakNotify) cb_scg_destroy, gee);
gee->scg = NULL;
g_object_weak_unref (G_OBJECT (gee->scg),
(GWeakNotify) cb_scg_destroy, gee);
gee->scg = NULL;
}
}
......
......@@ -29,7 +29,6 @@ struct _Workbook {
gchar *filename;
FileFormatLevel file_format_level;
GnumFileSaver *file_saver;
gint file_saver_sig_id;
/* Undo support */
GSList *undo_commands;
......
......@@ -100,13 +100,12 @@ workbook_history_update (GList *wl, gchar *filename)
}
static void
cb_saver_destroy_event (GtkObject *obj, gpointer *data)
cb_saver_finalize (GnumFileSaver *saver, Workbook *wb)
{
g_return_if_fail (IS_GNUM_FILE_SAVER (obj));
g_return_if_fail (IS_WORKBOOK (data));
WORKBOOK (data)->file_saver = NULL;
WORKBOOK (data)->file_saver_sig_id = 0;
g_return_if_fail (IS_GNUM_FILE_SAVER (saver));
g_return_if_fail (IS_WORKBOOK (wb));
g_return_if_fail (wb->file_saver == saver);
wb->file_saver = NULL;
}
static void
......@@ -117,9 +116,10 @@ workbook_finalize (GObject *wb_object)
wb->priv->during_destruction = TRUE;
if (wb->file_saver_sig_id != 0) {
gtk_signal_disconnect (GTK_OBJECT (wb->file_saver), wb->file_saver_sig_id);
wb->file_saver_sig_id = 0;
if (wb->file_saver != NULL) {
g_object_weak_unref (G_OBJECT (wb->file_saver),
(GWeakNotify) cb_saver_finalize, wb);
wb->file_saver = NULL;
}
/* Remove all the sheet controls to avoid displaying while we exit */
......@@ -422,7 +422,6 @@ workbook_new (void)
} while (!is_unique);
wb->file_format_level = FILE_FL_NEW;
wb->file_saver = NULL;
wb->file_saver_sig_id = 0;
wb->priv->during_destruction = FALSE;
......@@ -540,22 +539,21 @@ workbook_set_saveinfo (Workbook *wb, const gchar *file_name,
g_return_val_if_fail (wb != NULL, FALSE);
g_return_val_if_fail (file_name != NULL, FALSE);
g_return_val_if_fail (level > FILE_FL_NONE && level <= FILE_FL_AUTO,
FALSE);
FALSE);
if (level < wb->file_format_level ||
!workbook_set_filename (wb, file_name)) {
!workbook_set_filename (wb, file_name))
return FALSE;
}
wb->file_format_level = level;
if (wb->file_saver_sig_id != 0)
gtk_signal_disconnect (GTK_OBJECT (wb->file_saver), wb->file_saver_sig_id);
if (wb->file_saver != NULL)
g_object_weak_unref (G_OBJECT (wb->file_saver),
(GWeakNotify) cb_saver_finalize, wb);
wb->file_saver = fs;
wb->file_saver_sig_id = (wb->file_saver == NULL) ? 0
: g_signal_connect (G_OBJECT (wb->file_saver),
"destroy",
G_CALLBACK (cb_saver_destroy_event), wb);
if (fs != NULL)
g_object_weak_ref (G_OBJECT (fs),
(GWeakNotify) cb_saver_finalize, wb);
return TRUE;
}
......
......@@ -29,7 +29,6 @@ struct _Workbook {
gchar *filename;
FileFormatLevel file_format_level;
GnumFileSaver *file_saver;
gint file_saver_sig_id;
/* Undo support */
GSList *undo_commands;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment