evolution r37326 - in branches/gnome-2-24/plugins: google-account-setup webdav-account-setup



Author: mcrha
Date: Wed Feb 25 10:53:04 2009
New Revision: 37326
URL: http://svn.gnome.org/viewvc/evolution?rev=37326&view=rev

Log:
2009-02-25  Milan Crha  <mcrha redhat com>

	** Fix for bug #559719

	* google-contacts-source.c: (struct ui_data), (destroy_ui_data), (plugin_google_contacts):
	* plugins/google-account-setup/plugins/webdav-account-setup/webdav-contacts-source.c: (destroy_ui_data), (plugin_webdav_contacts):
	Use it's own/unique name for the property on the 'epl' and free the widget only if it wasn't freed yet.



Modified:
   branches/gnome-2-24/plugins/google-account-setup/ChangeLog
   branches/gnome-2-24/plugins/google-account-setup/google-contacts-source.c
   branches/gnome-2-24/plugins/webdav-account-setup/ChangeLog
   branches/gnome-2-24/plugins/webdav-account-setup/webdav-contacts-source.c

Modified: branches/gnome-2-24/plugins/google-account-setup/google-contacts-source.c
==============================================================================
--- branches/gnome-2-24/plugins/google-account-setup/google-contacts-source.c	(original)
+++ branches/gnome-2-24/plugins/google-account-setup/google-contacts-source.c	Wed Feb 25 10:53:04 2009
@@ -246,10 +246,19 @@
     g_free (value_string);
 }
 
+struct ui_data {
+	GtkWidget *widget;
+};
+
 static void
 destroy_ui_data(gpointer data)
 {
-	gtk_widget_destroy((GtkWidget *)data);
+	struct ui_data *ui = data;
+
+	if (ui && ui->widget)
+		gtk_widget_destroy (ui->widget);
+
+	g_free (ui);
 }
 
 GtkWidget *
@@ -282,14 +291,14 @@
     int        time;
 
     GtkWidget    *ssl_cb;
+    struct ui_data *ui;
 
     source = t->source;
     group = e_source_peek_group (source);
 
     base_uri = e_source_group_peek_base_uri (group);
 
-    g_object_set_data_full (G_OBJECT (epl), "widget", NULL,
-			(GDestroyNotify)gtk_widget_destroy);
+    g_object_set_data (G_OBJECT (epl), "gwidget", NULL);
 
     if (strcmp (base_uri, "google://")) {
         return NULL;
@@ -375,8 +384,11 @@
     g_object_set_data (G_OBJECT (interval_sb), "interval-combo", interval_combo);
     g_object_set_data (G_OBJECT (interval_combo), "interval-sb", interval_sb);
 
-    g_object_set_data_full(G_OBJECT(epl), "widget", vbox2,
-			destroy_ui_data);
+    ui = g_malloc0 (sizeof (struct ui_data));
+    ui->widget = vbox2;
+    g_object_set_data_full(G_OBJECT(epl), "gwidget", ui, destroy_ui_data);
+    g_signal_connect (ui->widget, "destroy", G_CALLBACK (gtk_widget_destroyed), &ui->widget);
+
     g_signal_connect (G_OBJECT (username_entry), "changed",
                       G_CALLBACK (on_username_entry_changed),
                       source);

Modified: branches/gnome-2-24/plugins/webdav-account-setup/webdav-contacts-source.c
==============================================================================
--- branches/gnome-2-24/plugins/webdav-account-setup/webdav-contacts-source.c	(original)
+++ branches/gnome-2-24/plugins/webdav-account-setup/webdav-contacts-source.c	Wed Feb 25 10:53:04 2009
@@ -272,12 +272,14 @@
 }
 
 static void
-destroy_ui_data(gpointer data)
+destroy_ui_data (gpointer data)
 {
-	ui_data *ui_data = data;
+	ui_data *ui = data;
 
-	gtk_widget_destroy(ui_data->box);
-	g_free(ui_data);
+	if (ui && ui->box)
+		gtk_widget_destroy (ui->box);
+
+	g_free (ui);
 }
 
 GtkWidget *
@@ -304,8 +306,7 @@
 
 	base_uri = e_source_group_peek_base_uri (group);
 
-	g_object_set_data_full (G_OBJECT (epl), "widget", NULL,
-			(GDestroyNotify)gtk_widget_destroy);
+	g_object_set_data (G_OBJECT (epl), "wwidget", NULL);
 
 	if (strcmp(base_uri, BASE_URI) != 0) {
 		return NULL;
@@ -369,8 +370,8 @@
 	gtk_widget_show_all(vbox2);
 
 	uidata->box = vbox2;
-	g_object_set_data_full(G_OBJECT(epl), "widget", uidata,
-			destroy_ui_data);
+	g_object_set_data_full(G_OBJECT(epl), "wwidget", uidata, destroy_ui_data);
+	g_signal_connect (uidata->box, "destroy", G_CALLBACK (gtk_widget_destroyed), &uidata->box);
 
 	g_signal_connect(G_OBJECT(uidata->username_entry), "changed",
 			G_CALLBACK(on_entry_changed), uidata);



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