diff options
author | Ted Gould <ted@gould.cx> | 2010-08-30 16:55:36 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-08-30 16:55:36 -0500 |
commit | e156eaea70d4e06dc3935a067223587de71e2d71 (patch) | |
tree | 95ff156b6b1b206d9ec228192be3b9aa200f2db3 /src | |
parent | 3e00412e0950f6c4e0d27c5f046120017c38738c (diff) | |
download | ayatana-indicator-datetime-e156eaea70d4e06dc3935a067223587de71e2d71.tar.gz ayatana-indicator-datetime-e156eaea70d4e06dc3935a067223587de71e2d71.tar.bz2 ayatana-indicator-datetime-e156eaea70d4e06dc3935a067223587de71e2d71.zip |
Create the service proxy and give it a lifecycle
Diffstat (limited to 'src')
-rw-r--r-- | src/indicator-datetime.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c index 7034fb8..a72fe6f 100644 --- a/src/indicator-datetime.c +++ b/src/indicator-datetime.c @@ -29,6 +29,9 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <glib/gi18n-lib.h> #include <gio/gio.h> +/* DBus Stuff */ +#include <dbus/dbus-glib.h> + /* Indicator Stuff */ #include <libindicator/indicator.h> #include <libindicator/indicator-object.h> @@ -78,6 +81,8 @@ struct _IndicatorDatetimePrivate { IndicatorServiceManager * sm; DbusmenuGtkMenu * menu; + DBusGProxy * service_proxy; + GSettings * settings; }; @@ -220,6 +225,8 @@ indicator_datetime_init (IndicatorDatetime *self) self->priv->show_day = FALSE; self->priv->custom_string = g_strdup(DEFAULT_TIME_FORMAT); + self->priv->service_proxy = NULL; + self->priv->sm = NULL; self->priv->menu = NULL; @@ -259,6 +266,16 @@ indicator_datetime_init (IndicatorDatetime *self) self->priv->sm = indicator_service_manager_new_version(SERVICE_NAME, SERVICE_VERSION); + DBusGConnection * session = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); + if (session != NULL) { + self->priv->service_proxy = dbus_g_proxy_new_for_name(session, + SERVICE_NAME, + SERVICE_OBJ, + SERVICE_IFACE); + + /* TODO: Add signal handler */ + } + return; } @@ -297,6 +314,11 @@ indicator_datetime_dispose (GObject *object) self->priv->settings = NULL; } + if (self->priv->service_proxy != NULL) { + g_object_unref(self->priv->service_proxy); + self->priv->service_proxy = NULL; + } + G_OBJECT_CLASS (indicator_datetime_parent_class)->dispose (object); return; } |