Re: [evolution-patches] initial addressbook patches



good catch updated e-addressbook-view.c attached with several more
fixes... 

--Larry

On Fri, 2003-06-13 at 17:46, Chris Toshok wrote:
> On Fri, 2003-06-13 at 11:07, Larry Ewing wrote:
> > This isn't complete but I thought I'd get what I have out there for
> > people to look at while I continue working on it.
> 
> 
> > RCS file:
> > /cvs/gnome/evolution/addressbook/gui/widgets/e-addressbook-view.c,v
> > retrieving revision 1.114
> > diff -u -p -r1.114 e-addressbook-view.c
> > --- widgets/e-addressbook-view.c        11 May 2003 21:51:45
> > -0000      1.114
> > +++ widgets/e-addressbook-view.c        13 Jun 2003 18:04:11 -0000
> > @@ -784,6 +786,7 @@ delete (GtkWidget *widget, CardAndBook *
> >                         }
> >                 }
> >                 e_free_object_list(list);
> > +               g_object_unref(list);
> >         }
> >  }
> 
> shouldn't need that g_object_unref, as list is a GList, not an EList.
> 
> Chris
Index: e-addressbook-view.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/widgets/e-addressbook-view.c,v
retrieving revision 1.114
diff -u -p -r1.114 e-addressbook-view.c
--- e-addressbook-view.c	11 May 2003 21:51:45 -0000	1.114
+++ e-addressbook-view.c	14 Jun 2003 01:07:50 -0000
@@ -648,6 +648,8 @@ has_email_address_1(gint model_row,
 
 	if (e_list_length (email) > 0)
 		*has_email = TRUE;
+
+	g_object_unref (email);
 }
 
 static gboolean
@@ -784,6 +786,7 @@ delete (GtkWidget *widget, CardAndBook *
 			}
 		}
 		e_free_object_list(list);
+		g_object_unref(book);
 	}
 }
 
@@ -809,22 +812,30 @@ static void
 new_card (GtkWidget *widget, CardAndBook *card_and_book)
 {
 	EBook *book;
+	ECard *card;
 
 	g_object_get(card_and_book->view->model,
 		     "book", &book,
 		     NULL);
-	e_addressbook_show_contact_editor (book, e_card_new(""), TRUE, TRUE);
+
+	e_addressbook_show_contact_editor (book, card = e_card_new(""), TRUE, TRUE);
+	g_object_unref(book);
+	g_object_unref(card);
 }
 
 static void
 new_list (GtkWidget *widget, CardAndBook *card_and_book)
 {
 	EBook *book;
+	ECard *card;
 
 	g_object_get(card_and_book->view->model,
 		     "book", &book,
 		     NULL);
-	e_addressbook_show_contact_list_editor (book, e_card_new(""), TRUE, TRUE);
+
+	e_addressbook_show_contact_list_editor (book, card = e_card_new(""), TRUE, TRUE);
+	g_object_unref(book);
+	g_object_unref(card);
 }
 
 #if 0
@@ -1220,6 +1231,9 @@ table_double_click(ETableScrolled *table
 			e_addressbook_show_contact_list_editor (book, card, FALSE, view->editable);
 		else
 			e_addressbook_show_contact_editor (book, card, FALSE, view->editable);
+
+		g_object_unref (book);
+		g_object_unref (card);
 	}
 }
 
@@ -1407,6 +1421,9 @@ treeview_row_activated(GtkTreeView *tree
 		e_addressbook_show_contact_list_editor (book, card, FALSE, view->editable);
 	else
 		e_addressbook_show_contact_editor (book, card, FALSE, view->editable);
+
+	g_object_unref (book);
+	g_object_unref (card);
 }
 
 static void
@@ -1652,6 +1669,8 @@ e_addressbook_view_print(EAddressbookVie
 			      "book", &book,
 			      NULL);
 		print = e_contact_print_dialog_new(book, query);
+
+		g_object_unref(book);
 		g_free(query);
 		gtk_widget_show_all(print);
 	}
@@ -1667,7 +1686,7 @@ e_addressbook_view_print(EAddressbookVie
 
 		g_object_get(view->widget, "table", &etable, NULL);
 		printable = e_table_get_printable(etable);
-
+		g_object_unref(etable);
 		g_object_ref (view->widget);
 
 		g_object_set_data (G_OBJECT (dialog), "table", view->widget);
@@ -1704,6 +1723,7 @@ e_addressbook_view_print_preview(EAddres
 			      "book", &book,
 			      NULL);
 		e_contact_print_preview(book, query);
+		g_object_unref(book);
 		g_free(query);
 	}
 	else if (view->view_type == E_ADDRESSBOOK_VIEW_TABLE) {
@@ -1716,6 +1736,7 @@ e_addressbook_view_print_preview(EAddres
 
 		g_object_get(view->widget, "table", &etable, NULL);
 		printable = e_table_get_printable(etable);
+		g_object_unref(etable);
 
 		master = gnome_print_job_new(NULL);
 		config = gnome_print_job_get_config (master);
@@ -1947,6 +1968,7 @@ view_transfer_cards (EAddressbookView *v
 	parent_window = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (view)));
 
 	e_addressbook_transfer_cards (book, cards, delete_from_source, parent_window);
+	g_object_unref(book);
 }
 
 void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]