From 568721955a601b46ea433d7e6f03daec8eb29ef7 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Mon, 15 Oct 2007 12:05:57 +0300 Subject: [PATCH] Fix non-hildon case with idle callback id variables --- src/map-download.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/map-download.c b/src/map-download.c index 6b32e90..4bfb998 100644 --- a/src/map-download.c +++ b/src/map-download.c @@ -391,6 +391,8 @@ else { g_tree_insert(_pui_tree, pui, pui); #ifdef WITH_OSSO if (iap_is_connected() && !_curl_sid) +#else + if (!_curl_sid) #endif _curl_sid = g_timeout_add(100,(GSourceFunc)map_download_timeout, NULL); /* Don't do anything else. */ @@ -414,8 +416,7 @@ if (++_curr_download == _num_downloads) { #endif _num_downloads = _curr_download = 0; } else - hildon_banner_set_fraction(HILDON_BANNER(_download_banner), - _curr_download / (double)_num_downloads); + hildon_banner_set_fraction(HILDON_BANNER(_download_banner), _curr_download / (double)_num_downloads); return FALSE; } @@ -438,8 +439,7 @@ pui = g_slice_new(ProgressUpdateInfo); pui->tilex = tilex; pui->tiley = tiley; pui->zoom = zoom; -pui->priority = (abs((gint) tilex - unit2tile(_center.unitx)) - + abs((gint) tiley - unit2tile(_center.unity))); +pui->priority = (abs((gint) tilex - unit2tile(_center.unitx)) + abs((gint) tiley - unit2tile(_center.unity))); if (!retries) pui->priority = -pui->priority; /* "Negative" makes them lowest pri. */ pui->retries = retries; @@ -457,11 +457,16 @@ pui->file = NULL; g_tree_insert(_pui_tree, pui, pui); #ifdef WITH_OSSO if (iap_is_connected() && !_curl_sid) +#else +if (!_curl_sid) #endif _curl_sid = g_timeout_add(100, (GSourceFunc) map_download_timeout, NULL); -if (!_num_downloads++ && !_download_banner) - _download_banner = hildon_banner_show_progress(_window, NULL,_("Downloading maps")); +if (!_num_downloads++ && !_download_banner) { + gchar buffer[100]; + g_snprintf(buffer, 100, _("Downloading maps (%d/%d)"), _curr_download, _num_downloads); + _download_banner = hildon_banner_show_progress(_window, NULL, buffer); +} } void -- 2.39.5