Initizalize and deinitialize the osso context

This commit is contained in:
Faheem Pervez 2009-04-07 23:23:27 +02:00 committed by Christian Dywan
parent 7f85c28b92
commit 0ffda1fe27
2 changed files with 23 additions and 0 deletions

View file

@ -49,6 +49,10 @@
#include <locale.h> #include <locale.h>
#endif #endif
#if HAVE_HILDON
#include <libosso.h>
#endif
#define MIDORI_HISTORY_ERROR g_quark_from_string("MIDORI_HISTORY_ERROR") #define MIDORI_HISTORY_ERROR g_quark_from_string("MIDORI_HISTORY_ERROR")
typedef enum typedef enum
@ -1354,6 +1358,9 @@ main (int argc,
sqlite3* db; sqlite3* db;
gint max_history_age; gint max_history_age;
#endif #endif
#if HAVE_HILDON
osso_context_t* osso_context;
#endif
#if ENABLE_NLS #if ENABLE_NLS
setlocale (LC_ALL, ""); setlocale (LC_ALL, "");
@ -1404,6 +1411,16 @@ main (int argc,
if (run) if (run)
return midori_run_script (uris ? *uris : NULL); 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 (); app = midori_app_new ();
/* FIXME: The app might be 'running' but actually showing a dialog /* FIXME: The app might be 'running' but actually showing a dialog
after a crash, so running a new window isn't a good idea. */ after a crash, so running a new window isn't a good idea. */
@ -1688,6 +1705,10 @@ main (int argc,
gtk_main (); gtk_main ();
#if HAVE_HILDON
osso_deinitialize (osso_context);
#endif
#if HAVE_SQLITE #if HAVE_SQLITE
settings = katze_object_get_object (app, "settings"); settings = katze_object_get_object (app, "settings");
g_object_get (settings, "maximum-history-age", &max_history_age, NULL); g_object_get (settings, "maximum-history-age", &max_history_age, NULL);

View file

@ -149,6 +149,8 @@ def configure (conf):
if option_enabled ('hildon'): if option_enabled ('hildon'):
check_pkg ('hildon-1', mandatory=False, var='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] hildon = ['N/A','yes'][conf.env['HAVE_HILDON'] == 1]
else: else:
option_checkfatal ('hildon', 'Maemo integration') option_checkfatal ('hildon', 'Maemo integration')