Use threaded fetch for first tile
authorAndy Spencer <andy753421@gmail.com>
Tue, 9 Feb 2010 17:03:52 +0000 (17:03 +0000)
committerAndy Spencer <andy753421@gmail.com>
Tue, 9 Feb 2010 17:03:52 +0000 (17:03 +0000)
src/plugins/elev.c
src/plugins/map.c
src/plugins/sat.c

index 5ea94ea..6599964 100644 (file)
@@ -268,6 +268,13 @@ static void _on_location_changed(GisViewer *viewer,
        g_thread_create(_update_tiles, elev, FALSE, NULL);
 }
 
+static gpointer _threaded_init(GisPluginElev *elev)
+{
+       _load_tile(elev->tiles, elev);
+       _update_tiles(elev);
+       return NULL;
+}
+
 /***********
  * Methods *
  ***********/
@@ -286,8 +293,7 @@ GisPluginElev *gis_plugin_elev_new(GisViewer *viewer)
        elev->viewer = g_object_ref(viewer);
 
        /* Load initial tiles */
-       _load_tile(elev->tiles, elev);
-       g_thread_create(_update_tiles, elev, FALSE, NULL);
+       g_thread_create((GThreadFunc)_threaded_init, elev, FALSE, NULL);
 
        /* Connect signals */
        elev->sigid = g_signal_connect(elev->viewer, "location-changed",
index c787224..d304391 100644 (file)
@@ -156,6 +156,13 @@ static void _on_location_changed(GisViewer *viewer,
        g_thread_create(_update_tiles, map, FALSE, NULL);
 }
 
+static gpointer _threaded_init(GisPluginMap *map)
+{
+       _load_tile(map->tiles, map);
+       _update_tiles(map);
+       return NULL;
+}
+
 /***********
  * Methods *
  ***********/
@@ -174,8 +181,7 @@ GisPluginMap *gis_plugin_map_new(GisViewer *viewer)
        map->viewer = g_object_ref(viewer);
 
        /* Load initial tiles */
-       _load_tile(map->tiles, map);
-       g_thread_create(_update_tiles, map, FALSE, NULL);
+       g_thread_create((GThreadFunc)_threaded_init, map, FALSE, NULL);
 
        /* Connect signals */
        map->sigid = g_signal_connect(map->viewer, "location-changed",
index edbe652..fae0c37 100644 (file)
@@ -147,6 +147,13 @@ static void _on_location_changed(GisViewer *viewer,
        g_thread_create(_update_tiles, sat, FALSE, NULL);
 }
 
+static gpointer _threaded_init(GisPluginSat *sat)
+{
+       _load_tile(sat->tiles, sat);
+       _update_tiles(sat);
+       return NULL;
+}
+
 /***********
  * Methods *
  ***********/
@@ -165,8 +172,7 @@ GisPluginSat *gis_plugin_sat_new(GisViewer *viewer)
        sat->viewer = g_object_ref(viewer);
 
        /* Load initial tiles */
-       _load_tile(sat->tiles, sat);
-       g_thread_create(_update_tiles, sat, FALSE, NULL);
+       g_thread_create((GThreadFunc)_threaded_init, sat, FALSE, NULL);
 
        /* Connect signals */
        sat->sigid = g_signal_connect(sat->viewer, "location-changed",