From 58a3bab86bdedaa37a8c121f3ca3c0bac6dc0663 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Thu, 13 Sep 2007 17:36:45 +0300 Subject: [PATCH] Fix usage of renamed functions. Misc other stuff. --- src/iap.c | 75 +++++++++++++++++++--------------------------- src/maemo-osso.c | 5 ++-- src/map-download.h | 1 + src/map.h | 1 - 4 files changed, 34 insertions(+), 48 deletions(-) diff --git a/src/iap.c b/src/iap.c index e2d2ead..c26c19f 100644 --- a/src/iap.c +++ b/src/iap.c @@ -8,63 +8,52 @@ #include #include "iap.h" -#include "map.h" +#include "map-download.h" #include "gps.h" +#include "config-gconf.h" gboolean iap_connecting=FALSE; gboolean iap_connected=TRUE; void iap_callback(struct iap_event_t *event, void *arg) { - printf("%s()\n", __PRETTY_FUNCTION__); - iap_connecting = FALSE; - if (event->type == OSSO_IAP_CONNECTED && !iap_connected) { - iap_connected = TRUE; - config_update_proxy(); - if (!_curl_sid) - _curl_sid = g_timeout_add(100, - (GSourceFunc) - curl_download_timeout, NULL); - } - vprintf("%s(): return\n", __PRETTY_FUNCTION__); +iap_connecting = FALSE; +if (event->type == OSSO_IAP_CONNECTED && !iap_connected) { + iap_connected = TRUE; + config_update_proxy(); + if (!_curl_sid) + _curl_sid = g_timeout_add(100, (GSourceFunc)map_download_timeout, NULL); +} } DBusHandlerResult get_connection_status_signal_cb(DBusConnection * connection, DBusMessage * message, void *user_data) { - gchar *iap_name = NULL, *iap_nw_type = NULL, *iap_state = NULL; - printf("%s()\n", __PRETTY_FUNCTION__); +gchar *iap_name = NULL, *iap_nw_type = NULL, *iap_state = NULL; - /* check signal */ - if (!dbus_message_is_signal(message, - ICD_DBUS_INTERFACE, - ICD_STATUS_CHANGED_SIG)) { - vprintf("%s(): return DBUS_HANDLER_RESULT_NOT_YET_HANDLED\n", - __PRETTY_FUNCTION__); - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; - } +/* check signal */ +if (!dbus_message_is_signal(message, ICD_DBUS_INTERFACE, ICD_STATUS_CHANGED_SIG)) { + vprintf("%s(): return DBUS_HANDLER_RESULT_NOT_YET_HANDLED\n", __PRETTY_FUNCTION__); + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; +} - if (!dbus_message_get_args(message, NULL, - DBUS_TYPE_STRING, &iap_name, - DBUS_TYPE_STRING, &iap_nw_type, - DBUS_TYPE_STRING, &iap_state, - DBUS_TYPE_INVALID)) { - vprintf("%s(): return DBUS_HANDLER_RESULT_NOT_YET_HANDLED\n", - __PRETTY_FUNCTION__); +if (!dbus_message_get_args(message, NULL, + DBUS_TYPE_STRING, &iap_name, + DBUS_TYPE_STRING, &iap_nw_type, + DBUS_TYPE_STRING, &iap_state, + DBUS_TYPE_INVALID)) { + vprintf("%s(): return DBUS_HANDLER_RESULT_NOT_YET_HANDLED\n", __PRETTY_FUNCTION__); return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; - } +} - printf(" > iap_state = %s\n", iap_state); - if (!strcmp(iap_state, "CONNECTED")) { - if (!iap_connected) { - iap_connected = TRUE; - config_update_proxy(); - if (!_curl_sid) - _curl_sid = g_timeout_add(100, - (GSourceFunc) - curl_download_timeout, - NULL); +printf(" > iap_state = %s\n", iap_state); +if (!strcmp(iap_state, "CONNECTED")) { + if (!iap_connected) { + iap_connected = TRUE; + config_update_proxy(); + if (!_curl_sid) + _curl_sid = g_timeout_add(100, (GSourceFunc)map_download_timeout, NULL); } } else if (iap_connected) { iap_connected = FALSE; @@ -73,10 +62,8 @@ get_connection_status_signal_cb(DBusConnection * connection, _curl_sid = 0; } } - - vprintf("%s(): return DBUS_HANDLER_RESULT_HANDLED\n", - __PRETTY_FUNCTION__); - return DBUS_HANDLER_RESULT_HANDLED; +vprintf("%s(): return DBUS_HANDLER_RESULT_HANDLED\n", __PRETTY_FUNCTION__); +return DBUS_HANDLER_RESULT_HANDLED; } void diff --git a/src/maemo-osso.c b/src/maemo-osso.c index c50bf95..be322b0 100644 --- a/src/maemo-osso.c +++ b/src/maemo-osso.c @@ -17,6 +17,7 @@ #include #include "map.h" +#include "map-download.h" #include "route.h" #include "mapper-types.h" #include "bt.h" @@ -80,9 +81,7 @@ if (state->system_inactivity_ind) { /* Start curl in case there are downloads pending. */ if (iap_is_connected() && !_curl_sid) - _curl_sid = g_timeout_add(100, - (GSourceFunc) - curl_download_timeout, NULL); + _curl_sid = g_timeout_add(100, (GSourceFunc)map_download_timeout, NULL); } vprintf("%s(): return\n", __PRETTY_FUNCTION__); } diff --git a/src/map-download.h b/src/map-download.h index d2b6a16..1fe6b83 100644 --- a/src/map-download.h +++ b/src/map-download.h @@ -5,6 +5,7 @@ #include #include +#include "mapper-types.h" CURLM *_curl_multi; GQueue *_curl_easy_queue; diff --git a/src/map.h b/src/map.h index 74afd1e..cac230d 100644 --- a/src/map.h +++ b/src/map.h @@ -69,7 +69,6 @@ gboolean _map_location_known; gdouble _map_location_dist; gboolean map_key_zoom_timeout(); -gboolean curl_download_timeout(); void map_set_autozoom(gboolean az); int map_zoom(gint zdir); -- 2.39.5