diff options
author | Jonathon Jongsma <jonathon@quotidian.org> | 2009-12-09 04:14:26 +0800 |
---|---|---|
committer | Jonathon Jongsma <jonathon@quotidian.org> | 2009-12-09 04:38:00 +0800 |
commit | e0ee2c648c2b101c3e8f1600fe9dcadf34963a63 (patch) | |
tree | 8699065dd24ea9f9d044e0e66c2d2f7d303bfcfb /e-util/e-alert-activity.c | |
parent | 5a90243de020efcc86e0a93698bdeaf932cc88ba (diff) | |
download | gsoc2013-evolution-e0ee2c648c2b101c3e8f1600fe9dcadf34963a63.tar.gz gsoc2013-evolution-e0ee2c648c2b101c3e8f1600fe9dcadf34963a63.tar.zst gsoc2013-evolution-e0ee2c648c2b101c3e8f1600fe9dcadf34963a63.zip |
Use EAlert API in EAlertActivity rather than using g_object_get_data
previously we were storing the EAlert's primary and secondary text in the dialog
object (using g_object_set_data_full). Since EAlertDialog encapsulates an
EAlert and we have access to the underlying EAlert object, we can just use the
EAlert API to get the primary and secondary text rather than storing duplicates
copies of it in the dialog.
Diffstat (limited to 'e-util/e-alert-activity.c')
-rw-r--r-- | e-util/e-alert-activity.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/e-util/e-alert-activity.c b/e-util/e-alert-activity.c index 1e8f915213..23f747fe1f 100644 --- a/e-util/e-alert-activity.c +++ b/e-util/e-alert-activity.c @@ -14,12 +14,16 @@ * You should have received a copy of the GNU Lesser General Public * License along with the program; if not, see <http://www.gnu.org/licenses/> * + * Authors: + * Jonathon Jongsma <jonathon.jongsma@collabora.co.uk> * * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * Copyright (C) 2009 Intel Corporation * */ #include "e-alert-activity.h" +#include "e-alert-dialog.h" #define E_ALERT_ACTIVITY_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ @@ -100,21 +104,27 @@ alert_activity_constructed (GObject *object) { EActivity *activity; EAlertActivity *alert_activity; + EAlert *alert; GtkWidget *message_dialog; - const gchar *primary_text; - const gchar *secondary_text; + gchar *primary_text; + gchar *secondary_text; alert_activity = E_ALERT_ACTIVITY (object); message_dialog = e_alert_activity_get_message_dialog (alert_activity); object = G_OBJECT (message_dialog); - primary_text = g_object_get_data (object, "primary"); - secondary_text = g_object_get_data (object, "secondary"); + alert = e_alert_dialog_get_alert (E_ALERT_DIALOG (message_dialog)); + primary_text = e_alert_get_primary_text (alert); + secondary_text = e_alert_get_secondary_text (alert); + g_object_unref (alert); activity = E_ACTIVITY (alert_activity); e_activity_set_primary_text (activity, primary_text); e_activity_set_secondary_text (activity, secondary_text); + g_free (primary_text); + g_free (secondary_text); + /* This is a constructor property, so can't do it in init(). * XXX What we really want to do is override the property's * default value, but GObject does not support that. */ |