aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/alarm-notify/alarm-notify.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-09-27 13:13:42 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-09-27 21:31:13 +0800
commite2b6ff7a6c1e1580c26ee0719b349151e8dad6fd (patch)
treed2d2ce8eb509717d412ad3171059e470ff0e7030 /calendar/gui/alarm-notify/alarm-notify.c
parentc520043a094d81d222aa0c3e23b0035ddb89d0bf (diff)
downloadgsoc2013-evolution-e2b6ff7a6c1e1580c26ee0719b349151e8dad6fd.tar
gsoc2013-evolution-e2b6ff7a6c1e1580c26ee0719b349151e8dad6fd.tar.gz
gsoc2013-evolution-e2b6ff7a6c1e1580c26ee0719b349151e8dad6fd.tar.bz2
gsoc2013-evolution-e2b6ff7a6c1e1580c26ee0719b349151e8dad6fd.tar.lz
gsoc2013-evolution-e2b6ff7a6c1e1580c26ee0719b349151e8dad6fd.tar.xz
gsoc2013-evolution-e2b6ff7a6c1e1580c26ee0719b349151e8dad6fd.tar.zst
gsoc2013-evolution-e2b6ff7a6c1e1580c26ee0719b349151e8dad6fd.zip
Miscellaneous cleanups from the account-mgmt branch.
Reducing diff noise so I can see important changes easier when comparing branches. A few API changes, but nothing that affects functionality.
Diffstat (limited to 'calendar/gui/alarm-notify/alarm-notify.c')
-rw-r--r--calendar/gui/alarm-notify/alarm-notify.c40
1 files changed, 33 insertions, 7 deletions
diff --git a/calendar/gui/alarm-notify/alarm-notify.c b/calendar/gui/alarm-notify/alarm-notify.c
index 3256e39780..e612b0c56c 100644
--- a/calendar/gui/alarm-notify/alarm-notify.c
+++ b/calendar/gui/alarm-notify/alarm-notify.c
@@ -37,6 +37,10 @@
#include "alarm-queue.h"
#include "config-data.h"
+#define ALARM_NOTIFY_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), TYPE_ALARM_NOTIFY, AlarmNotifyPrivate))
+
#define APPLICATION_ID "org.gnome.EvolutionAlarmNotify"
struct _AlarmNotifyPrivate {
@@ -55,7 +59,13 @@ typedef struct {
GList *removals;
} ProcessRemovalsData;
-G_DEFINE_TYPE (AlarmNotify, alarm_notify, GTK_TYPE_APPLICATION)
+/* Forward Declarations */
+static void alarm_notify_initable_init (GInitableIface *interface);
+
+G_DEFINE_TYPE_WITH_CODE (
+ AlarmNotify, alarm_notify, GTK_TYPE_APPLICATION,
+ G_IMPLEMENT_INTERFACE (
+ G_TYPE_INITABLE, alarm_notify_initable_init))
static void
process_removal_in_hash (const gchar *uri,
@@ -212,7 +222,7 @@ alarm_notify_finalize (GObject *object)
AlarmNotifyPrivate *priv;
gint ii;
- priv = ALARM_NOTIFY (object)->priv;
+ priv = ALARM_NOTIFY_GET_PRIVATE (object);
for (ii = 0; ii < E_CAL_CLIENT_SOURCE_TYPE_LAST; ii++) {
g_hash_table_foreach (
@@ -264,6 +274,15 @@ alarm_notify_activate (GApplication *application)
* if there are no handlers connected to this signal. */
}
+static gboolean
+alarm_notify_initable (GInitable *initable,
+ GCancellable *cancellable,
+ GError **error)
+{
+ /* XXX Just return TRUE for now. We'll have use for this soon. */
+ return TRUE;
+}
+
static void
alarm_notify_class_init (AlarmNotifyClass *class)
{
@@ -281,12 +300,18 @@ alarm_notify_class_init (AlarmNotifyClass *class)
}
static void
+alarm_notify_initable_init (GInitableIface *interface)
+{
+ /* XXX Awkward name since we're missing an 'E' prefix. */
+ interface->init = alarm_notify_initable;
+}
+
+static void
alarm_notify_init (AlarmNotify *an)
{
gint ii;
- an->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- an, TYPE_ALARM_NOTIFY, AlarmNotifyPrivate);
+ an->priv = ALARM_NOTIFY_GET_PRIVATE (an);
an->priv->mutex = g_mutex_new ();
an->priv->selected_calendars = config_data_get_calendars (
"/apps/evolution/calendar/sources");
@@ -317,10 +342,11 @@ alarm_notify_get_selected_calendars (AlarmNotify *an)
* Returns: a newly-created #AlarmNotify
**/
AlarmNotify *
-alarm_notify_new (void)
+alarm_notify_new (GCancellable *cancellable,
+ GError **error)
{
- return g_object_new (
- TYPE_ALARM_NOTIFY,
+ return g_initable_new (
+ TYPE_ALARM_NOTIFY, cancellable, error,
"application-id", APPLICATION_ID, NULL);
}