From: Kaj-Michael Lang Date: Wed, 25 Jul 2007 10:52:10 +0000 (+0300) Subject: More maemo/hildon fixes. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12f884d30ababaa91b8770cc74b5f9243830bd45;p=mapper More maemo/hildon fixes. --- diff --git a/debian/control b/debian/control index a9728b8..d9ab4d8 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: mapper Section: maemo/Applications Priority: optional Maintainer: Kaj-Michael Lang -Build-Depends: debhelper (>= 4.0.0), intltool, hildon-base-lib-dev, hildon-libs-dev, hildon-fm-dev, libgtk2.0-dev, libosso-gnomevfs2-dev, libglib2.0-dev, libdbus-glib-1-dev, libosso-dev, libsqlite3-dev, osso-ic-dev +Build-Depends: debhelper (>= 4.0.0), intltool, hildon-base-lib-dev, hildon-libs-dev, hildon-fm-dev, libgtk2.0-dev, libosso-gnomevfs2-dev, libglib2.0-dev, libdbus-glib-1-dev, libosso-dev, libsqlite3-dev (>=3.3.17), osso-ic-dev Standards-Version: 3.6.0 Package: mapper diff --git a/src/gps-nmea-parse.c b/src/gps-nmea-parse.c index e3dfbca..069fba5 100644 --- a/src/gps-nmea-parse.c +++ b/src/gps-nmea-parse.c @@ -15,6 +15,10 @@ #include #include +#ifdef WITH_HILDON +#include +#endif + #include "utils.h" #include "bt.h" #include "gps.h" diff --git a/src/hildon-wrappers.h b/src/hildon-wrappers.h index cab0424..0cb6dfc 100644 --- a/src/hildon-wrappers.h +++ b/src/hildon-wrappers.h @@ -5,6 +5,8 @@ * Wrappers and defines for non-hildon build ****************************************************************************/ +#include "config.h" + #ifndef WITH_HILDON /* Define hildon key to use gdk keys */ #define HILDON_HARDKEY_UP GDK_Up diff --git a/src/iap.c b/src/iap.c index 7bdac9a..1125aa4 100644 --- a/src/iap.c +++ b/src/iap.c @@ -12,7 +12,7 @@ #include "gps.h" gboolean iap_connecting=FALSE; -gboolean iap_connected=FALSE; +gboolean iap_connected=TRUE; void iap_callback(struct iap_event_t *event, void *arg) { diff --git a/src/maemo-osso.c b/src/maemo-osso.c index bbefb59..ec531ec 100644 --- a/src/maemo-osso.c +++ b/src/maemo-osso.c @@ -7,6 +7,7 @@ #define _GNU_SOURCE #include +#include #ifdef WITH_HILDON @@ -22,6 +23,18 @@ #include "gps.h" #include "settings-gconf.h" #include "settings.h" +#include "ui-common.h" + +gint +dbus_cb_default(const gchar *interface, const gchar *method, + GArray *arguments, gpointer data, osso_rpc_t *retval) +{ +if(!strcmp(method, "top_application")) + gtk_idle_add((GSourceFunc)window_present, NULL); +retval->type = DBUS_TYPE_INVALID; + +return OSSO_OK; +} void osso_cb_hw_state(osso_hw_state_t * state, gpointer data) { diff --git a/src/map.c b/src/map.c index f4e5677..800c13d 100644 --- a/src/map.c +++ b/src/map.c @@ -20,9 +20,22 @@ #include #include #include - #include +#ifdef WITH_HILDON +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif + + #include "utils.h" #include "map.h" #include "osm.h" diff --git a/src/osm.c b/src/osm.c index 0238f00..913759e 100644 --- a/src/osm.c +++ b/src/osm.c @@ -1239,15 +1239,15 @@ osm_node_isin=g_hash_table_new(g_direct_hash, g_direct_equal); static void storage_free(void) { -g_hash_table_unref(osm_nodes); -g_hash_table_unref(osm_segments); - -g_hash_table_unref(osm_place_country); -g_hash_table_unref(osm_place_city); -g_hash_table_unref(osm_place_suburb); -g_hash_table_unref(osm_place_village); -g_hash_table_unref(osm_place_region); -g_hash_table_unref(osm_node_isin); +g_hash_table_destroy(osm_nodes); +g_hash_table_destroy(osm_segments); + +g_hash_table_destroy(osm_place_country); +g_hash_table_destroy(osm_place_city); +g_hash_table_destroy(osm_place_suburb); +g_hash_table_destroy(osm_place_village); +g_hash_table_destroy(osm_place_region); +g_hash_table_destroy(osm_node_isin); } /************************************************************************/ diff --git a/src/settings-gui.c b/src/settings-gui.c index 772b6f5..249ea63 100644 --- a/src/settings-gui.c +++ b/src/settings-gui.c @@ -22,6 +22,21 @@ #include #include +#ifdef WITH_HILDON +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif + #include "utils.h" #include "poi.h" #include "gps.h" diff --git a/src/ui-common.c b/src/ui-common.c index b324f41..65f4e69 100644 --- a/src/ui-common.c +++ b/src/ui-common.c @@ -916,17 +916,18 @@ void mapper_init(gint argc, gchar ** argv) config_init(); + g_set_application_name("Mapper"); + #ifdef WITH_HILDON /* Initialize _program. */ _program = HILDON_PROGRAM(hildon_program_get_instance()); - g_set_application_name("Tablet Mapper"); /* Initialize _window. */ _window = GTK_WIDGET(hildon_window_new()); hildon_program_add_window(_program, HILDON_WINDOW(_window)); #else _window = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_window_set_title(GTK_WINDOW(_window), "Desktop Mapper"); + gtk_window_set_title(GTK_WINDOW(_window), "Mapper"); gtk_widget_set_size_request(GTK_WIDGET(_window), WINDOW_SIZE_X, WINDOW_SIZE_Y); gtk_window_resize(GTK_WINDOW(_window), WINDOW_SIZE_X, WINDOW_SIZE_Y); gtk_window_set_resizable(GTK_WINDOW(_window), TRUE); @@ -948,6 +949,8 @@ void mapper_init(gint argc, gchar ** argv) /* Create and add widgets and supporting data. */ gtk_container_add(GTK_CONTAINER(_window), notebook); hildon_program_set_common_toolbar(_program, _toolbar); + + gtk_widget_show_all(notebook); #else vbox_main = gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(_window), vbox_main); @@ -1216,8 +1219,7 @@ void mapper_init(gint argc, gchar ** argv) /* Add D-BUS signal handler for 'status_changed' */ { DBusConnection *dbus_conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL); - gchar *filter_string = - g_strdup_printf("interface=%s", ICD_DBUS_INTERFACE); + gchar *filter_string = g_strdup_printf("interface=%s", ICD_DBUS_INTERFACE); /* add match */ dbus_bus_add_match(dbus_conn, filter_string, NULL); @@ -1235,15 +1237,13 @@ void mapper_init(gint argc, gchar ** argv) GError *error = NULL; /* Initialize D-Bus. */ - if (NULL == - (dbus_conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error))) { + if (NULL == (dbus_conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error))) { g_printerr("Failed to open connection to D-Bus: %s.\n", error->message); error = NULL; } - if (NULL == - (_rfcomm_req_proxy = + if (NULL == (_rfcomm_req_proxy = dbus_g_proxy_new_for_name(dbus_conn, BTCOND_SERVICE, BTCOND_REQ_PATH, BTCOND_REQ_INTERFACE))) { @@ -1252,11 +1252,7 @@ void mapper_init(gint argc, gchar ** argv) } } -#ifdef DEBUG - _iap_connected = TRUE; #endif -#endif - gtk_idle_add((GSourceFunc) window_present, NULL); vprintf("%s(): return\n", __PRETTY_FUNCTION__);