Rearranged order of things getting destroyed.
2000-05-09 Christopher James Lahey <clahey@helixcode.com> * gui/component/e-addressbook-model.c: Rearranged order of things getting destroyed. * gui/minicard/e-minicard-view.c: Rearranged order of things getting destroyed. Don't set attributes of non-null or destroyed items. Destroy parent object when destroyed. Maintain ref_count of items in list. * gui/minicard/e-minicard.c: Don't set attributes of non-null items. * gui/minicard/e-reflow-sorted.c: Maintain ref_count of items in list. * gui/minicard/e-reflow.c: Maintain ref_count of items in list. Destroy parent object when destroyed. svn path=/trunk/; revision=2935
This commit is contained in:
committed by
Chris Lahey
parent
3f6ddb02e8
commit
6692c3b3d4
@@ -1,3 +1,22 @@
|
||||
2000-05-09 Christopher James Lahey <clahey@helixcode.com>
|
||||
|
||||
* gui/component/e-addressbook-model.c: Rearranged order of things
|
||||
getting destroyed.
|
||||
|
||||
* gui/minicard/e-minicard-view.c: Rearranged order of things
|
||||
getting destroyed. Don't set attributes of non-null or destroyed
|
||||
items. Destroy parent object when destroyed. Maintain ref_count
|
||||
of items in list.
|
||||
|
||||
* gui/minicard/e-minicard.c: Don't set attributes of non-null
|
||||
items.
|
||||
|
||||
* gui/minicard/e-reflow-sorted.c: Maintain ref_count of items in
|
||||
list.
|
||||
|
||||
* gui/minicard/e-reflow.c: Maintain ref_count of items in list.
|
||||
Destroy parent object when destroyed.
|
||||
|
||||
2000-05-09 Christopher James Lahey <clahey@helixcode.com>
|
||||
|
||||
* backend/ebook/e-card-simple.c: Fixed some indentation.
|
||||
|
||||
@@ -37,8 +37,6 @@ addressbook_destroy(GtkObject *object)
|
||||
|
||||
if (model->get_view_idle)
|
||||
g_source_remove(model->get_view_idle);
|
||||
if (model->book)
|
||||
gtk_object_unref(GTK_OBJECT(model->book));
|
||||
if (model->book_view && model->create_card_id)
|
||||
gtk_signal_disconnect(GTK_OBJECT (model->book_view),
|
||||
model->create_card_id);
|
||||
@@ -48,6 +46,8 @@ addressbook_destroy(GtkObject *object)
|
||||
if (model->book_view && model->modify_card_id)
|
||||
gtk_signal_disconnect(GTK_OBJECT (model->book_view),
|
||||
model->modify_card_id);
|
||||
if (model->book)
|
||||
gtk_object_unref(GTK_OBJECT(model->book));
|
||||
if (model->book_view)
|
||||
gtk_object_unref(GTK_OBJECT(model->book_view));
|
||||
|
||||
|
||||
@@ -126,10 +126,12 @@ modify_card(EBookView *book_view, const GList *cards, EMinicardView *view)
|
||||
ECard *card = cards->data;
|
||||
gchar *id = e_card_get_id(card);
|
||||
GnomeCanvasItem *item = e_reflow_sorted_get_item(E_REFLOW_SORTED(view), id);
|
||||
gnome_canvas_item_set(item,
|
||||
"card", card,
|
||||
NULL);
|
||||
e_reflow_sorted_reorder_item(E_REFLOW_SORTED(view), id);
|
||||
if (item && !GTK_OBJECT_DESTROYED(item)) {
|
||||
gnome_canvas_item_set(item,
|
||||
"card", card,
|
||||
NULL);
|
||||
e_reflow_sorted_reorder_item(E_REFLOW_SORTED(view), id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,6 +171,7 @@ book_view_loaded (EBook *book, EBookStatus status, EBookView *book_view, gpointe
|
||||
"card_changed",
|
||||
GTK_SIGNAL_FUNC(modify_card),
|
||||
view);
|
||||
g_list_foreach(E_REFLOW(view)->items, (GFunc) gtk_object_unref, NULL);
|
||||
g_list_foreach(E_REFLOW(view)->items, (GFunc) gtk_object_destroy, NULL);
|
||||
g_list_free(E_REFLOW(view)->items);
|
||||
E_REFLOW(view)->items = NULL;
|
||||
@@ -242,8 +245,6 @@ e_minicard_view_destroy (GtkObject *object)
|
||||
|
||||
if (view->get_view_idle)
|
||||
g_source_remove(view->get_view_idle);
|
||||
if (view->book)
|
||||
gtk_object_unref(GTK_OBJECT(view->book));
|
||||
if (view->book_view && view->create_card_id)
|
||||
gtk_signal_disconnect(GTK_OBJECT (view->book_view),
|
||||
view->create_card_id);
|
||||
@@ -253,8 +254,12 @@ e_minicard_view_destroy (GtkObject *object)
|
||||
if (view->book_view && view->modify_card_id)
|
||||
gtk_signal_disconnect(GTK_OBJECT (view->book_view),
|
||||
view->modify_card_id);
|
||||
if (view->book)
|
||||
gtk_object_unref(GTK_OBJECT(view->book));
|
||||
if (view->book_view)
|
||||
gtk_object_unref(GTK_OBJECT(view->book_view));
|
||||
|
||||
GTK_OBJECT_CLASS(parent_class)->destroy (object);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -533,11 +533,13 @@ remodel( EMinicard *e_minicard )
|
||||
GList *list;
|
||||
char *file_as;
|
||||
|
||||
file_as = e_card_simple_get(e_minicard->simple, E_CARD_SIMPLE_FIELD_FILE_AS);
|
||||
gnome_canvas_item_set( e_minicard->header_text,
|
||||
"text", file_as ? file_as : "",
|
||||
NULL );
|
||||
g_free(file_as);
|
||||
if (e_minicard->header_text) {
|
||||
file_as = e_card_simple_get(e_minicard->simple, E_CARD_SIMPLE_FIELD_FILE_AS);
|
||||
gnome_canvas_item_set( e_minicard->header_text,
|
||||
"text", file_as ? file_as : "",
|
||||
NULL );
|
||||
g_free(file_as);
|
||||
}
|
||||
|
||||
list = e_minicard->fields;
|
||||
e_minicard->fields = NULL;
|
||||
|
||||
@@ -167,6 +167,7 @@ e_reflow_sorted_remove_item(EReflowSorted *e_reflow_sorted, const gchar *id)
|
||||
EReflow *reflow = E_REFLOW(e_reflow_sorted);
|
||||
reflow->items = g_list_remove_link(reflow->items, list);
|
||||
g_list_free_1(list);
|
||||
gtk_object_unref(GTK_OBJECT(item));
|
||||
gtk_object_destroy(GTK_OBJECT(item));
|
||||
if ( GTK_OBJECT_FLAGS( e_reflow_sorted ) & GNOME_CANVAS_ITEM_REALIZED ) {
|
||||
e_canvas_item_request_reflow(item);
|
||||
@@ -207,6 +208,7 @@ e_reflow_sorted_reorder_item(EReflowSorted *e_reflow_sorted, const gchar *id)
|
||||
if (item) {
|
||||
EReflow *reflow = E_REFLOW(e_reflow_sorted);
|
||||
reflow->items = g_list_remove_link(reflow->items, list);
|
||||
gtk_object_unref(GTK_OBJECT(item));
|
||||
g_list_free_1(list);
|
||||
e_reflow_sorted_add_item(reflow, item);
|
||||
}
|
||||
@@ -218,6 +220,7 @@ e_reflow_sorted_add_item(EReflow *reflow, GnomeCanvasItem *item)
|
||||
EReflowSorted *e_reflow_sorted = E_REFLOW_SORTED(reflow);
|
||||
if ( e_reflow_sorted->compare_func ) {
|
||||
reflow->items = g_list_insert_sorted(reflow->items, item, e_reflow_sorted->compare_func);
|
||||
gtk_object_ref(GTK_OBJECT(item));
|
||||
|
||||
if ( GTK_OBJECT_FLAGS( e_reflow_sorted ) & GNOME_CANVAS_ITEM_REALIZED ) {
|
||||
gnome_canvas_item_set(item,
|
||||
|
||||
@@ -190,8 +190,11 @@ e_reflow_destroy (GtkObject *object)
|
||||
{
|
||||
EReflow *reflow = E_REFLOW(object);
|
||||
|
||||
g_list_foreach(reflow->items, (GFunc) gtk_object_unref, NULL);
|
||||
g_list_free(reflow->items);
|
||||
reflow->items = NULL;
|
||||
|
||||
GTK_OBJECT_CLASS(parent_class)->destroy (object);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -448,6 +451,7 @@ static void
|
||||
e_reflow_real_add_item(EReflow *e_reflow, GnomeCanvasItem *item)
|
||||
{
|
||||
e_reflow->items = g_list_append(e_reflow->items, item);
|
||||
gtk_object_ref(item);
|
||||
if ( GTK_OBJECT_FLAGS( e_reflow ) & GNOME_CANVAS_ITEM_REALIZED ) {
|
||||
gnome_canvas_item_set(item,
|
||||
"width", (double) e_reflow->column_width,
|
||||
|
||||
@@ -37,8 +37,6 @@ addressbook_destroy(GtkObject *object)
|
||||
|
||||
if (model->get_view_idle)
|
||||
g_source_remove(model->get_view_idle);
|
||||
if (model->book)
|
||||
gtk_object_unref(GTK_OBJECT(model->book));
|
||||
if (model->book_view && model->create_card_id)
|
||||
gtk_signal_disconnect(GTK_OBJECT (model->book_view),
|
||||
model->create_card_id);
|
||||
@@ -48,6 +46,8 @@ addressbook_destroy(GtkObject *object)
|
||||
if (model->book_view && model->modify_card_id)
|
||||
gtk_signal_disconnect(GTK_OBJECT (model->book_view),
|
||||
model->modify_card_id);
|
||||
if (model->book)
|
||||
gtk_object_unref(GTK_OBJECT(model->book));
|
||||
if (model->book_view)
|
||||
gtk_object_unref(GTK_OBJECT(model->book_view));
|
||||
|
||||
|
||||
@@ -126,10 +126,12 @@ modify_card(EBookView *book_view, const GList *cards, EMinicardView *view)
|
||||
ECard *card = cards->data;
|
||||
gchar *id = e_card_get_id(card);
|
||||
GnomeCanvasItem *item = e_reflow_sorted_get_item(E_REFLOW_SORTED(view), id);
|
||||
gnome_canvas_item_set(item,
|
||||
"card", card,
|
||||
NULL);
|
||||
e_reflow_sorted_reorder_item(E_REFLOW_SORTED(view), id);
|
||||
if (item && !GTK_OBJECT_DESTROYED(item)) {
|
||||
gnome_canvas_item_set(item,
|
||||
"card", card,
|
||||
NULL);
|
||||
e_reflow_sorted_reorder_item(E_REFLOW_SORTED(view), id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,6 +171,7 @@ book_view_loaded (EBook *book, EBookStatus status, EBookView *book_view, gpointe
|
||||
"card_changed",
|
||||
GTK_SIGNAL_FUNC(modify_card),
|
||||
view);
|
||||
g_list_foreach(E_REFLOW(view)->items, (GFunc) gtk_object_unref, NULL);
|
||||
g_list_foreach(E_REFLOW(view)->items, (GFunc) gtk_object_destroy, NULL);
|
||||
g_list_free(E_REFLOW(view)->items);
|
||||
E_REFLOW(view)->items = NULL;
|
||||
@@ -242,8 +245,6 @@ e_minicard_view_destroy (GtkObject *object)
|
||||
|
||||
if (view->get_view_idle)
|
||||
g_source_remove(view->get_view_idle);
|
||||
if (view->book)
|
||||
gtk_object_unref(GTK_OBJECT(view->book));
|
||||
if (view->book_view && view->create_card_id)
|
||||
gtk_signal_disconnect(GTK_OBJECT (view->book_view),
|
||||
view->create_card_id);
|
||||
@@ -253,8 +254,12 @@ e_minicard_view_destroy (GtkObject *object)
|
||||
if (view->book_view && view->modify_card_id)
|
||||
gtk_signal_disconnect(GTK_OBJECT (view->book_view),
|
||||
view->modify_card_id);
|
||||
if (view->book)
|
||||
gtk_object_unref(GTK_OBJECT(view->book));
|
||||
if (view->book_view)
|
||||
gtk_object_unref(GTK_OBJECT(view->book_view));
|
||||
|
||||
GTK_OBJECT_CLASS(parent_class)->destroy (object);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -533,11 +533,13 @@ remodel( EMinicard *e_minicard )
|
||||
GList *list;
|
||||
char *file_as;
|
||||
|
||||
file_as = e_card_simple_get(e_minicard->simple, E_CARD_SIMPLE_FIELD_FILE_AS);
|
||||
gnome_canvas_item_set( e_minicard->header_text,
|
||||
"text", file_as ? file_as : "",
|
||||
NULL );
|
||||
g_free(file_as);
|
||||
if (e_minicard->header_text) {
|
||||
file_as = e_card_simple_get(e_minicard->simple, E_CARD_SIMPLE_FIELD_FILE_AS);
|
||||
gnome_canvas_item_set( e_minicard->header_text,
|
||||
"text", file_as ? file_as : "",
|
||||
NULL );
|
||||
g_free(file_as);
|
||||
}
|
||||
|
||||
list = e_minicard->fields;
|
||||
e_minicard->fields = NULL;
|
||||
|
||||
@@ -167,6 +167,7 @@ e_reflow_sorted_remove_item(EReflowSorted *e_reflow_sorted, const gchar *id)
|
||||
EReflow *reflow = E_REFLOW(e_reflow_sorted);
|
||||
reflow->items = g_list_remove_link(reflow->items, list);
|
||||
g_list_free_1(list);
|
||||
gtk_object_unref(GTK_OBJECT(item));
|
||||
gtk_object_destroy(GTK_OBJECT(item));
|
||||
if ( GTK_OBJECT_FLAGS( e_reflow_sorted ) & GNOME_CANVAS_ITEM_REALIZED ) {
|
||||
e_canvas_item_request_reflow(item);
|
||||
@@ -207,6 +208,7 @@ e_reflow_sorted_reorder_item(EReflowSorted *e_reflow_sorted, const gchar *id)
|
||||
if (item) {
|
||||
EReflow *reflow = E_REFLOW(e_reflow_sorted);
|
||||
reflow->items = g_list_remove_link(reflow->items, list);
|
||||
gtk_object_unref(GTK_OBJECT(item));
|
||||
g_list_free_1(list);
|
||||
e_reflow_sorted_add_item(reflow, item);
|
||||
}
|
||||
@@ -218,6 +220,7 @@ e_reflow_sorted_add_item(EReflow *reflow, GnomeCanvasItem *item)
|
||||
EReflowSorted *e_reflow_sorted = E_REFLOW_SORTED(reflow);
|
||||
if ( e_reflow_sorted->compare_func ) {
|
||||
reflow->items = g_list_insert_sorted(reflow->items, item, e_reflow_sorted->compare_func);
|
||||
gtk_object_ref(GTK_OBJECT(item));
|
||||
|
||||
if ( GTK_OBJECT_FLAGS( e_reflow_sorted ) & GNOME_CANVAS_ITEM_REALIZED ) {
|
||||
gnome_canvas_item_set(item,
|
||||
|
||||
@@ -190,8 +190,11 @@ e_reflow_destroy (GtkObject *object)
|
||||
{
|
||||
EReflow *reflow = E_REFLOW(object);
|
||||
|
||||
g_list_foreach(reflow->items, (GFunc) gtk_object_unref, NULL);
|
||||
g_list_free(reflow->items);
|
||||
reflow->items = NULL;
|
||||
|
||||
GTK_OBJECT_CLASS(parent_class)->destroy (object);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -448,6 +451,7 @@ static void
|
||||
e_reflow_real_add_item(EReflow *e_reflow, GnomeCanvasItem *item)
|
||||
{
|
||||
e_reflow->items = g_list_append(e_reflow->items, item);
|
||||
gtk_object_ref(item);
|
||||
if ( GTK_OBJECT_FLAGS( e_reflow ) & GNOME_CANVAS_ITEM_REALIZED ) {
|
||||
gnome_canvas_item_set(item,
|
||||
"width", (double) e_reflow->column_width,
|
||||
|
||||
@@ -190,8 +190,11 @@ e_reflow_destroy (GtkObject *object)
|
||||
{
|
||||
EReflow *reflow = E_REFLOW(object);
|
||||
|
||||
g_list_foreach(reflow->items, (GFunc) gtk_object_unref, NULL);
|
||||
g_list_free(reflow->items);
|
||||
reflow->items = NULL;
|
||||
|
||||
GTK_OBJECT_CLASS(parent_class)->destroy (object);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -448,6 +451,7 @@ static void
|
||||
e_reflow_real_add_item(EReflow *e_reflow, GnomeCanvasItem *item)
|
||||
{
|
||||
e_reflow->items = g_list_append(e_reflow->items, item);
|
||||
gtk_object_ref(item);
|
||||
if ( GTK_OBJECT_FLAGS( e_reflow ) & GNOME_CANVAS_ITEM_REALIZED ) {
|
||||
gnome_canvas_item_set(item,
|
||||
"width", (double) e_reflow->column_width,
|
||||
|
||||
Reference in New Issue
Block a user