]> err.no Git - mapper/commitdiff
Fix non-hildon case with idle callback id variables
authorKaj-Michael Lang <milang@angel.tal.org>
Mon, 15 Oct 2007 09:05:57 +0000 (12:05 +0300)
committerKaj-Michael Lang <milang@angel.tal.org>
Mon, 15 Oct 2007 09:05:57 +0000 (12:05 +0300)
src/map-download.c

index 6b32e90428a357e27953159cd9bd490e36fda9a9..4bfb99883db6448c9095589c344572c3b9cfa2dc 100644 (file)
@@ -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