aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-02-25 18:52:45 +0800
committerMilan Crha <mcrha@src.gnome.org>2009-02-25 18:52:45 +0800
commit408ed636718294b0c0676bc6bdb690811c4793ac (patch)
treeca47bd9ef2a1c1c5c34419a165581a3e96836cbd
parent82d5ac92dacbd76fa446f3115866b56da730f0ec (diff)
downloadgsoc2013-evolution-408ed636718294b0c0676bc6bdb690811c4793ac.tar
gsoc2013-evolution-408ed636718294b0c0676bc6bdb690811c4793ac.tar.gz
gsoc2013-evolution-408ed636718294b0c0676bc6bdb690811c4793ac.tar.bz2
gsoc2013-evolution-408ed636718294b0c0676bc6bdb690811c4793ac.tar.lz
gsoc2013-evolution-408ed636718294b0c0676bc6bdb690811c4793ac.tar.xz
gsoc2013-evolution-408ed636718294b0c0676bc6bdb690811c4793ac.tar.zst
gsoc2013-evolution-408ed636718294b0c0676bc6bdb690811c4793ac.zip
** Fix for bug #559719
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. svn path=/trunk/; revision=37325
-rw-r--r--plugins/google-account-setup/ChangeLog8
-rw-r--r--plugins/google-account-setup/google-contacts-source.c22
-rw-r--r--plugins/webdav-account-setup/ChangeLog8
-rw-r--r--plugins/webdav-account-setup/webdav-contacts-source.c17
4 files changed, 42 insertions, 13 deletions
diff --git a/plugins/google-account-setup/ChangeLog b/plugins/google-account-setup/ChangeLog
index 628455a523..9842a40603 100644
--- a/plugins/google-account-setup/ChangeLog
+++ b/plugins/google-account-setup/ChangeLog
@@ -1,3 +1,11 @@
+2009-02-25 Milan Crha <mcrha@redhat.com>
+
+ ** Part of fix for bug #559719
+
+ * google-contacts-source.c: (struct ui_data), (destroy_ui_data),
+ (plugin_google_contacts): Use it's own/unique name for the property
+ on the 'epl' and free the widget only if it wasn't freed yet.
+
2009-01-29 Milan Crha <mcrha@redhat.com>
** Fix for bug #539467
diff --git a/plugins/google-account-setup/google-contacts-source.c b/plugins/google-account-setup/google-contacts-source.c
index f76b7e56ee..2ae9fba7b0 100644
--- a/plugins/google-account-setup/google-contacts-source.c
+++ b/plugins/google-account-setup/google-contacts-source.c
@@ -246,10 +246,19 @@ on_interval_combo_changed (GtkComboBox *combo, gpointer user_data)
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 @@ plugin_google_contacts (EPlugin *epl,
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 @@ plugin_google_contacts (EPlugin *epl,
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);
diff --git a/plugins/webdav-account-setup/ChangeLog b/plugins/webdav-account-setup/ChangeLog
index 29e3e82796..512d6a1318 100644
--- a/plugins/webdav-account-setup/ChangeLog
+++ b/plugins/webdav-account-setup/ChangeLog
@@ -1,3 +1,11 @@
+2009-02-25 Milan Crha <mcrha@redhat.com>
+
+ ** Part of fix for bug #559719
+
+ * 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.
+
2009-01-29 Milan Crha <mcrha@redhat.com>
** Fix for bug #539467
diff --git a/plugins/webdav-account-setup/webdav-contacts-source.c b/plugins/webdav-account-setup/webdav-contacts-source.c
index 2242b9050d..8edfa59372 100644
--- a/plugins/webdav-account-setup/webdav-contacts-source.c
+++ b/plugins/webdav-account-setup/webdav-contacts-source.c
@@ -272,12 +272,14 @@ on_toggle_changed(GtkToggleButton *tb, gpointer user_data)
}
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 @@ plugin_webdav_contacts(EPlugin *epl, EConfigHookItemFactoryData *data)
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 @@ plugin_webdav_contacts(EPlugin *epl, EConfigHookItemFactoryData *data)
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);