From: Faheem Pervez Date: Tue, 7 Apr 2009 21:23:27 +0000 (+0200) Subject: Initizalize and deinitialize the osso context X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ffda1fe2776a7bb9e99642e891ff206d50206e2;p=midori Initizalize and deinitialize the osso context --- diff --git a/midori/main.c b/midori/main.c index 4152661f..6d92ba3b 100644 --- a/midori/main.c +++ b/midori/main.c @@ -49,6 +49,10 @@ #include #endif +#if HAVE_HILDON + #include +#endif + #define MIDORI_HISTORY_ERROR g_quark_from_string("MIDORI_HISTORY_ERROR") typedef enum @@ -1354,6 +1358,9 @@ main (int argc, sqlite3* db; gint max_history_age; #endif + #if HAVE_HILDON + osso_context_t* osso_context; + #endif #if ENABLE_NLS setlocale (LC_ALL, ""); @@ -1404,6 +1411,16 @@ main (int argc, if (run) return midori_run_script (uris ? *uris : NULL); + #if HAVE_HILDON + osso_context = osso_initialize (PACKAGE_NAME, PACKAGE_VERSION, FALSE, NULL); + + if (!osso_context) + { + g_critical ("Error initializing OSSO D-Bus context - Midori"); + return 1; + } + #endif + app = midori_app_new (); /* FIXME: The app might be 'running' but actually showing a dialog after a crash, so running a new window isn't a good idea. */ @@ -1688,6 +1705,10 @@ main (int argc, gtk_main (); + #if HAVE_HILDON + osso_deinitialize (osso_context); + #endif + #if HAVE_SQLITE settings = katze_object_get_object (app, "settings"); g_object_get (settings, "maximum-history-age", &max_history_age, NULL); diff --git a/wscript b/wscript index 4ee9d820..51210817 100644 --- a/wscript +++ b/wscript @@ -149,6 +149,8 @@ def configure (conf): if option_enabled ('hildon'): check_pkg ('hildon-1', mandatory=False, var='HILDON') + if conf.env['HAVE_HILDON'] == 1: + check_pkg ('libosso', mandatory=False, var='HILDON') hildon = ['N/A','yes'][conf.env['HAVE_HILDON'] == 1] else: option_checkfatal ('hildon', 'Maemo integration')