evolution r37325 - in trunk/plugins: google-account-setup webdav-account-setup



Author: mcrha
Date: Wed Feb 25 10:52:45 2009
New Revision: 37325
URL: http://svn.gnome.org/viewvc/evolution?rev=37325&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:
   trunk/plugins/google-account-setup/ChangeLog
   trunk/plugins/google-account-setup/google-contacts-source.c
   trunk/plugins/webdav-account-setup/ChangeLog
   trunk/plugins/webdav-account-setup/webdav-contacts-source.c

Modified: trunk/plugins/google-account-setup/google-contacts-source.c
==============================================================================
--- trunk/plugins/google-account-setup/google-contacts-source.c	(original)
+++ trunk/plugins/google-account-setup/google-contacts-source.c	Wed Feb 25 10:52:45 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: trunk/plugins/webdav-account-setup/webdav-contacts-source.c
==============================================================================
--- trunk/plugins/webdav-account-setup/webdav-contacts-source.c	(original)
+++ trunk/plugins/webdav-account-setup/webdav-contacts-source.c	Wed Feb 25 10:52:45 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]