#include <modest-hildon-includes.h>
#include <osso-helplib.h>
#include <dbus_api/modest-dbus-callbacks.h>
+#include <libosso-abook/osso-abook.h>
#include <maemo/modest-osso-autosave-callbacks.h>
#include <libosso.h>
#include <alarmd/alarm_event.h> /* For alarm_event_add(), etc. */
#include <gtk/gtkmain.h>
#include <string.h>
+
#define HILDON_OSSO_URI_ACTION "uri-action"
#define URI_ACTION_COPY "copy:"
}
gboolean
-modest_platform_init (void)
+modest_platform_init (int argc, char *argv[])
{
osso_hw_state_t hw_state = { 0 };
DBusConnection *con;
+
osso_context =
osso_initialize(PACKAGE,PACKAGE_VERSION,
FALSE, NULL);
}
if ((con = osso_get_dbus_connection (osso_context)) == NULL) {
- g_printerr ("Could not get dbus connection\n");
+ g_printerr ("modest: could not get dbus connection\n");
return FALSE;
}
-
+
/* Add a D-Bus handler to be used when the main osso-rpc
* D-Bus handler has not handled something.
* We use this for D-Bus methods that need to use more complex types
NULL,
NULL)) {
- g_printerr ("Could not add D-Bus filter\n");
+ g_printerr ("modest: Could not add D-Bus filter\n");
return FALSE;
}
MODEST_DBUS_IFACE,
modest_dbus_req_handler, NULL /* user_data */);
if (result != OSSO_OK) {
- g_print("Error setting D-BUS callback (%d)\n", result);
- return OSSO_ERROR;
+ g_printerr ("modest: Error setting D-BUS callback (%d)\n", result);
+ return FALSE;
}
/* Add handler for Exit D-BUS messages.
result = osso_application_set_autosave_cb (osso_context,
modest_on_osso_application_autosave, NULL /* user_data */);
if (result != OSSO_OK) {
- g_warning ("osso_application_set_autosave_cb() failed.");
+ g_printerr ("modest: osso_application_set_autosave_cb() failed.\n");
+ return FALSE;
}
/* Get the initial update interval from gconf: */
on_modest_conf_update_interval_changed(conf, MODEST_CONF_UPDATE_INTERVAL,
MODEST_CONF_EVENT_KEY_CHANGED, NULL);
-
+
+ /* initialize the addressbook */
+ if (!osso_abook_init (&argc, &argv, osso_context)) {
+ g_printerr ("modest: failed to initialized addressbook\n");
+ return FALSE;
+ }
+
return TRUE;
}
}
gboolean
-modest_init_init_core (void)
+modest_init_init_core (int argc, char *argv[])
{
gboolean reset;
static gboolean invoked = FALSE;
init_i18n();
init_debug_g_type();
init_debug_logging();
+
+ if (!gnome_vfs_initialized()) {
+ if (!gnome_vfs_init ()) {
+ g_printerr ("modest: failed to init gnome-vfs\n");
+ return FALSE;
+ }
+ }
if (!modest_runtime_init()) {
modest_init_uninit ();
return FALSE;
}
-
+
/* do an initial guess for the device name */
init_device_name (modest_runtime_get_conf());
- if (!modest_platform_init()) {
+
+ if (!modest_platform_init(argc, argv)) {
modest_init_uninit ();
g_printerr ("modest: failed to run platform-specific initialization\n");
return FALSE;
init_stock_icons ();
/* Init notification system */
- #ifdef MODEST_HAVE_HILDON_NOTIFY
+#ifdef MODEST_HAVE_HILDON_NOTIFY
notify_init ("Basics");
- #endif
+#endif
+
return TRUE;
}
{
if (!modest_runtime_uninit())
g_printerr ("modest: failed to uninit runtime\n");
-
+
+ if (gnome_vfs_initialized())
+ gnome_vfs_shutdown ();
+
return TRUE;
}