From ba2367f68072eaed88c44e2def818520dbc934e1 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 2 May 2007 16:35:13 +0000 Subject: [PATCH] 2007-05-02 Murray Cumming * src/dbus_api/modest-dbus-callbacks.c: (modest_osso_cb_hw_state_handler): * src/dbus_api/modest-dbus-callbacks.h: * src/maemo/modest-platform.c: (modest_platform_init): Registered (empty) callbacks for the osso hardware state D-Bus signals, in case this has some effect on the ability for Maemo to ping the application. pmo-trunk-r1734 --- ChangeLog2 | 10 ++++++++++ src/dbus_api/modest-dbus-callbacks.c | 19 +++++++++++++++++++ src/dbus_api/modest-dbus-callbacks.h | 2 ++ src/maemo/modest-platform.c | 3 +++ 4 files changed, 34 insertions(+) diff --git a/ChangeLog2 b/ChangeLog2 index 1cc8fe3..880d60b 100644 --- a/ChangeLog2 +++ b/ChangeLog2 @@ -1,5 +1,15 @@ 2007-05-02 Murray Cumming + * src/dbus_api/modest-dbus-callbacks.c: + (modest_osso_cb_hw_state_handler): + * src/dbus_api/modest-dbus-callbacks.h: + * src/maemo/modest-platform.c: (modest_platform_init): + Registered (empty) callbacks for the osso hardware state D-Bus signals, + in case this has some effect on the ability for Maemo to ping the + application. + +2007-05-02 Murray Cumming + * src/modest-text-utils.c: (modest_text_utils_validate_recipient): Comment out an if() that checks a gchar for < 0, causing a build-breaking warning. It is probably a logic error, but I need to fix the build. diff --git a/src/dbus_api/modest-dbus-callbacks.c b/src/dbus_api/modest-dbus-callbacks.c index 1504c16..ab7e1d8 100644 --- a/src/dbus_api/modest-dbus-callbacks.c +++ b/src/dbus_api/modest-dbus-callbacks.c @@ -424,3 +424,22 @@ gint modest_dbus_req_handler(const gchar * interface, const gchar * method, else return OSSO_ERROR; } + +void +modest_osso_cb_hw_state_handler(osso_hw_state_t *state, gpointer data) +{ + printf("%s()\n", __PRETTY_FUNCTION__); + + if(state->system_inactivity_ind) + { + } + else if(state->save_unsaved_data_ind) + { + } + else + { + + } + + printf("debug: %s(): return\n", __PRETTY_FUNCTION__); +} diff --git a/src/dbus_api/modest-dbus-callbacks.h b/src/dbus_api/modest-dbus-callbacks.h index d88423f..26344f8 100644 --- a/src/dbus_api/modest-dbus-callbacks.h +++ b/src/dbus_api/modest-dbus-callbacks.h @@ -39,4 +39,6 @@ gint modest_dbus_req_handler(const gchar * interface, const gchar * method, GArray * arguments, gpointer data, osso_rpc_t * retval); +void modest_osso_cb_hw_state_handler(osso_hw_state_t *state, gpointer data); + #endif /* __MODEST_DBUS_CALLBACKS_H__ */ diff --git a/src/maemo/modest-platform.c b/src/maemo/modest-platform.c index 8d6ba12..b286c8f 100644 --- a/src/maemo/modest-platform.c +++ b/src/maemo/modest-platform.c @@ -67,6 +67,9 @@ modest_platform_init (void) return OSSO_ERROR; } + /* Register hardware event dbus callback: */ + osso_hw_set_event_cb(osso_context, NULL, modest_osso_cb_hw_state_handler, NULL); + /* Add handler for Exit D-BUS messages. * Not used because osso_application_set_exit_cb() is deprecated and obsolete: result = osso_application_set_exit_cb(osso_context, -- 1.7.9.5