diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-11-01 04:02:30 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2010-11-10 06:33:20 +0800 |
commit | 4a929caada81820d7499b09875870b84e9900912 (patch) | |
tree | f68e00a2c0e5c24d00ae0ec32c11570383a480e7 /e-util/e-alert-sink.c | |
parent | 3d7cfbbd2f67e40fea1a5c231e8fc7d6c28f2a01 (diff) | |
download | gsoc2013-evolution-4a929caada81820d7499b09875870b84e9900912.tar.gz gsoc2013-evolution-4a929caada81820d7499b09875870b84e9900912.tar.zst gsoc2013-evolution-4a929caada81820d7499b09875870b84e9900912.zip |
Pass an EAlertSink to e_alert_sink_submit_alert().
Passing a random GtkWidget and then searching its ancestors for an
EAlertSink turned out to be not as useful as I thought. Most of the
time we know about and have access to the widget that implements
EAlertSink, so just pass it directly as an EAlertSink.
Diffstat (limited to 'e-util/e-alert-sink.c')
-rw-r--r-- | e-util/e-alert-sink.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/e-util/e-alert-sink.c b/e-util/e-alert-sink.c index f26f114c71..2a8db40afb 100644 --- a/e-util/e-alert-sink.c +++ b/e-util/e-alert-sink.c @@ -66,35 +66,24 @@ e_alert_sink_default_init (EAlertSinkInterface *interface) /** * e_alert_sink_submit_alert: - * @widget: a #GtkWidget, either itself an #EAlertSink or a child of one + * @alert_sink: an #EAlertSink * @alert: an #EAlert * * This function is a place to pass #EAlert objects. Beyond that it has no * well-defined behavior. It's up to the widget implementing the #EAlertSink * interface to decide what to do with them. - * - * Either @widget or one of its ancestors must implement #EAlertSink. - * - * The default behavior is to display the @alert in a dialog. **/ void -e_alert_sink_submit_alert (GtkWidget *widget, +e_alert_sink_submit_alert (EAlertSink *alert_sink, EAlert *alert) { - GtkWidget *ancestor; + EAlertSinkInterface *interface; - g_return_if_fail (GTK_IS_WIDGET (widget)); + g_return_if_fail (E_IS_ALERT_SINK (alert_sink)); g_return_if_fail (E_IS_ALERT (alert)); - ancestor = gtk_widget_get_ancestor (widget, E_TYPE_ALERT_SINK); - - if (E_IS_ALERT_SINK (ancestor)) { - EAlertSinkInterface *interface; - - interface = E_ALERT_SINK_GET_INTERFACE (ancestor); - g_return_if_fail (interface->submit_alert != NULL); + interface = E_ALERT_SINK_GET_INTERFACE (alert_sink); + g_return_if_fail (interface->submit_alert != NULL); - interface->submit_alert (E_ALERT_SINK (ancestor), alert); - } else - alert_sink_fallback (widget, alert); + interface->submit_alert (alert_sink, alert); } |