aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-09-05 05:07:15 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-09-05 05:07:15 +0800
commit983fce5e535e4e203815767cf6899f6dc8c5242a (patch)
treed6ca3538c046798597275132c66be6da18733d7f /e-util
parentc95a226217a68703c48397c23ea8accc491d44e4 (diff)
downloadgsoc2013-evolution-983fce5e535e4e203815767cf6899f6dc8c5242a.tar
gsoc2013-evolution-983fce5e535e4e203815767cf6899f6dc8c5242a.tar.gz
gsoc2013-evolution-983fce5e535e4e203815767cf6899f6dc8c5242a.tar.bz2
gsoc2013-evolution-983fce5e535e4e203815767cf6899f6dc8c5242a.tar.lz
gsoc2013-evolution-983fce5e535e4e203815767cf6899f6dc8c5242a.tar.xz
gsoc2013-evolution-983fce5e535e4e203815767cf6899f6dc8c5242a.tar.zst
gsoc2013-evolution-983fce5e535e4e203815767cf6899f6dc8c5242a.zip
Kill the default parent window hack in e-error.c.
Fix as many cases that relied on it as I could find, but there may be more cases out there. They should be fixed too. Passing a NULL parent window to e_error_new() is illegal and will emit a runtime warning.
Diffstat (limited to 'e-util')
-rw-r--r--e-util/e-error.c34
-rw-r--r--e-util/e-error.h2
2 files changed, 3 insertions, 33 deletions
diff --git a/e-util/e-error.c b/e-util/e-error.c
index b672e1d17e..ee3c47e9bb 100644
--- a/e-util/e-error.c
+++ b/e-util/e-error.c
@@ -66,7 +66,6 @@ struct _e_error_table {
};
static GHashTable *error_table;
-static GSList *ee_parent_list;
/* ********************************************************************** */
@@ -433,12 +432,12 @@ e_error_newv(GtkWindow *parent, const gchar *tag, const gchar *arg0, va_list ap)
gtk_container_set_border_width (GTK_CONTAINER (action_area), 12);
gtk_container_set_border_width (GTK_CONTAINER (content_area), 0);
- if (parent == NULL && ee_parent_list)
- parent = (GtkWindow *)ee_parent_list->data;
if (parent)
gtk_window_set_transient_for ((GtkWindow *)dialog, parent);
else
- g_warning("No parent set, or default parent available for error dialog");
+ g_warning (
+ "Something called %s() with a NULL parent window. "
+ "This is no longer legal, please fix it.", G_STRFUNC);
domain = alloca(strlen(tag)+1);
strcpy(domain, tag);
@@ -668,30 +667,3 @@ e_error_count_buttons (GtkDialog *dialog)
return n_buttons;
}
-
-static void
-remove_parent(GtkWidget *w, GtkWidget *parent)
-{
- ee_parent_list = g_slist_remove(ee_parent_list, parent);
-}
-
-/**
- * e_error_default_parent:
- * @parent:
- *
- * Bit of a hack, set a default parent that will be used to parent any
- * error boxes if none is supplied.
- *
- * This may be called multiple times, and the last call will be the
- * main default. This function will keep track of the parents
- * destruction state.
- **/
-void
-e_error_default_parent(GtkWindow *parent)
-{
- if (g_slist_find(ee_parent_list, parent) == NULL) {
- ee_parent_list = g_slist_prepend(ee_parent_list, parent);
- g_signal_connect(parent, "destroy", G_CALLBACK(remove_parent), parent);
- }
-}
-
diff --git a/e-util/e-error.h b/e-util/e-error.h
index 7b9685aca6..38de4c86ed 100644
--- a/e-util/e-error.h
+++ b/e-util/e-error.h
@@ -56,6 +56,4 @@ gint e_error_runv(GtkWindow *parent, const gchar *tag, const gchar *arg0, va_lis
guint e_error_count_buttons (GtkDialog *dialog);
-void e_error_default_parent(GtkWindow *parent);
-
#endif /* !_E_ERROR_H */