From 7a6093db8586e5cb0625a6092ee8304af900941f Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Tue, 9 Feb 2010 17:03:52 +0000 Subject: [PATCH] Use threaded fetch for first tile --- src/plugins/elev.c | 10 ++++++++-- src/plugins/map.c | 10 ++++++++-- src/plugins/sat.c | 10 ++++++++-- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/plugins/elev.c b/src/plugins/elev.c index 5ea94ea..6599964 100644 --- a/src/plugins/elev.c +++ b/src/plugins/elev.c @@ -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", diff --git a/src/plugins/map.c b/src/plugins/map.c index c787224..d304391 100644 --- a/src/plugins/map.c +++ b/src/plugins/map.c @@ -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", diff --git a/src/plugins/sat.c b/src/plugins/sat.c index edbe652..fae0c37 100644 --- a/src/plugins/sat.c +++ b/src/plugins/sat.c @@ -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", -- 2.41.0