[Commits] about.c 1.2 1.3 callbacks.c 1.11 1.12 contactwindow.c 1.8 1.9

miras at claws-mail.org miras at claws-mail.org
Mon Nov 28 18:52:16 CET 2011


Update of /home/claws-mail/contacts/src
In directory claws-mail:/tmp/cvs-serv7749/src

Modified Files:
	about.c callbacks.c contactwindow.c 
Log Message:
2011-11-28 [mir]	0.6.0cvs29

	* configure.ac
	* plugins/ldap/ldap-plugin.c
	* src/about.c
	* src/callbacks.c
	* src/contactwindow.c
	    Mostly code cleaning.
	    - Fix one memory leak.
	    - Fix building on systems with GTK+2 < 2.24 

Index: callbacks.c
===================================================================
RCS file: /home/claws-mail/contacts/src/callbacks.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- callbacks.c	28 Nov 2011 07:34:50 -0000	1.11
+++ callbacks.c	28 Nov 2011 17:52:14 -0000	1.12
@@ -158,14 +158,12 @@
 	
 	if (win) {
     	debug_print("Closing application\n");
-		//gtk_widget_destroy(win->window);
 		gtk_widget_destroy(win->progress_dialog);
 		g_free(win->default_book);
 		g_free(win);
 		gtk_main_quit();
 	}
 	if (mainloop) {
-		//debug_print("main_loop [%p]\n", mainloop);
 		if (g_main_loop_is_running(mainloop))
 			g_main_loop_unref(mainloop);
 	}
@@ -607,7 +605,7 @@
 gint delete_event(GtkWidget* widget, GdkEvent* event, gpointer data) {
 	MainWindow* win = (MainWindow *) data;
 	shutdown_application(win);
-	//g_free(win);
+
     return TRUE;
 }
 
@@ -726,8 +724,6 @@
 		else {
 			view = GTK_TREE_VIEW(win->abook_list);
 			plugin = get_selected_plugin(view);
-			/*	abook = get_selected_address_book(view);
-				if (abook == NULL) {*/
 			iter = set_selection_combobox(win->window,
 							"[Edit book] Choose address book",
 							gtk_tree_view_get_model(view),
@@ -795,8 +791,6 @@
 	}
 	else {
 		view = GTK_TREE_VIEW(win->abook_list);
-/*	abook = get_selected_address_book(view);
-	if (abook == NULL) {*/
 		iter = set_selection_combobox(win->window,
 						"[Delete book] Choose address book",
 						gtk_tree_view_get_model(view),
@@ -923,8 +917,6 @@
 	}
 	else {
 		view = GTK_TREE_VIEW(win->abook_list);
-/*	abook = get_selected_address_book(view);
-	if (abook == NULL) {*/
 		iter = set_selection_combobox(win->window,
 						"[Close book] Choose address book",
 						gtk_tree_view_get_model(view),
@@ -940,7 +932,6 @@
 	if (abook && plugin) {
 		if (show_question(win->window, _("Close '%s' ?"), abook->abook_name)) {
 			plugin->abook_close(abook, &error);
-			/*address_book_free(&abook);*/
 			update_abook_list(win);
 		}
 	}
@@ -1001,7 +992,6 @@
 					}
 				}
 				if (! plugin->abook_set_config(book, NULL, &error)) {
-				/*if (! addr_book_set_config(book, &error)) {*/
 					if (plugin->abook_open(book, &error)) 
 						update_abook_list(win);
 				}
@@ -1386,8 +1376,6 @@
 	else {
 		book = *address_book = address_book_new();
 		title = g_strdup(_("New address book"));
-		/*if (! plugin->file_filter())
-			show_url = FALSE;*/
 	}
 	
 	dialog = gtk_dialog_new_with_buttons(
@@ -1504,7 +1492,6 @@
 				gtk_editable_get_chars(GTK_EDITABLE(input[3]), 0, -1);
 			response = TRUE;
 			if (plugin->extra_config()) {
-				//gslist_free(&book->extra_config, extra_config_free);
 				set_advanced_config(plugin, book, GTK_NOTEBOOK(notebook));
 			}
 			break;
@@ -1680,7 +1667,6 @@
 			new_contact = contact_copy(old_contact);
 			if (new_contact) {			
 				contact_set_attr(new_contact, col, new_text);
-				/*gtk_list_store_set(GTK_LIST_STORE(model), &iter, col, new_text, -1);*/
 				error = contact_write_to_backend(
 						plugin, abook, old_contact, new_contact);
 			}
@@ -1853,9 +1839,6 @@
 		win->selected_contact = NULL;
 	}
 	else {
-/*	view = GTK_TREE_VIEW(win->contact_list);
-	contact = get_selected_contact(view);
-	if (contact == NULL) {*/
 		iter = set_selection_combobox(win->window,
 						_("[Delete Contact] Choose contact to delete"),
 						gtk_tree_view_get_model(view),
@@ -1957,9 +1940,6 @@
 		win->selected_contact = NULL;
 	}
 	else {
-/*	view = GTK_TREE_VIEW(win->contact_list);
-	contact = get_selected_contact(view);
-	if (contact == NULL) {*/
 		iter = set_selection_combobox(win->window,
 						_("[Edit Contact] Choose contact to edit"),
 						gtk_tree_view_get_model(view),
@@ -2019,7 +1999,6 @@
 				g_free(error);
 			}
 			else {
-				//hash_table_dump(new_attribs, stderr);
 				plugin->attribs_set(new_attribs);
 			}
 			hash_table_free(&new_attribs);

Index: about.c
===================================================================
RCS file: /home/claws-mail/contacts/src/about.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- about.c	4 Oct 2011 20:21:40 -0000	1.2
+++ about.c	28 Nov 2011 17:52:14 -0000	1.3
@@ -92,6 +92,7 @@
     }
 }
 
+#if GTK_MINOR_VERSION > 23
 static void about_dialog_handle_link_cb(GtkAboutDialog *about,
                                         gchar *uri,
                                         gpointer data) {
@@ -101,6 +102,7 @@
     else
         about_dialog_handle_email_cb(about, uri, data);
 }
+#endif
 
 void about_dialog_show(GtkWidget* parent) {
     static const gchar *authors[] = {

Index: contactwindow.c
===================================================================
RCS file: /home/claws-mail/contacts/src/contactwindow.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- contactwindow.c	28 Nov 2011 07:34:50 -0000	1.8
+++ contactwindow.c	28 Nov 2011 17:52:14 -0000	1.9
@@ -162,7 +162,6 @@
 		}
 		else {
 			cw->email_dirty = FALSE;
-			//gslist_free(&cw->changed_emails, NULL);
 			if (contact_is_new) {
 				if (debug_get_mode()) {
 					contact_dump(contact, stderr);
@@ -561,6 +560,7 @@
 
 		pixbuf = gdk_pixbuf_new_from_file_at_scale(
 			file, PHOTO_WIDTH, PHOTO_HEIGHT, TRUE, &err);
+		g_free(err);
 		
 		if (pixbuf) {
 			gchar* image = base64_encode_data(file);
@@ -574,6 +574,7 @@
 		g_free(file);
 	}
 
+	g_object_unref(filter);
 	gtk_widget_destroy(dialog);
 }
 



More information about the Commits mailing list