#include "vikaggregatelayer.h"
#include "viklayerspanel.h"
#include "vikdemlayer.h"
-#include "vikdemlayer_pixmap.h"
-#include "vikmapslayer.h"
#include "dialog.h"
#include "dem.h"
static VikToolInterface dem_tools[] = {
{ N_("DEM Download/Import"), (VikToolConstructorFunc) dem_layer_download_create, NULL, NULL, NULL,
(VikToolMouseFunc) dem_layer_download_click, NULL, (VikToolMouseFunc) dem_layer_download_release,
- (VikToolKeyFunc) NULL, &cursor_demdl },
+ (VikToolKeyFunc) NULL, GDK_CURSOR_IS_PIXMAP, &cursor_demdl_pixbuf },
};
VikLayerInterface vik_dem_layer_interface = {
"DEM",
- &demlayer_pixbuf,
+ &vikdemlayer_pixbuf,
dem_tools,
sizeof(dem_tools) / sizeof(dem_tools[0]),
(intlon >= 0) ? 'E' : 'W',
ABS(intlon) );
- DownloadOptions options = { NULL, 0 };
+ static DownloadOptions options = { NULL, 0, a_check_map_file };
a_ftp_download_get_url ( SRTM_FTP_SITE, src_fn, p->dest, &options );
g_free ( src_fn );
}
ABS(i),
(j >= 0) ? 'E' : 'W',
ABS(j) );
- if ( access(buf, F_OK ) == 0 ) {
+ if ( g_file_test(buf, G_FILE_TEST_EXISTS ) == TRUE ) {
VikCoord ne, sw;
gint x1, y1, x2, y2;
sw.north_south = i;
g_snprintf(buf, sizeof(buf), "%sdem24k/%d/",
MAPS_CACHE_DIR,
(gint) i );
- if ( access(buf, F_OK) != 0 )
+ if ( g_file_test(buf, G_FILE_TEST_EXISTS) == FALSE )
continue;
for (j = floor(min_lon*8)/8; j <= floor(max_lon*8)/8; j+=0.125) {
/* check lon dir first -- faster */
MAPS_CACHE_DIR,
(gint) i,
(gint) j );
- if ( access(buf, F_OK) != 0 )
+ if ( g_file_test(buf, G_FILE_TEST_EXISTS) == FALSE )
continue;
g_snprintf(buf, sizeof(buf), "%sdem24k/%d/%d/%.03f,%.03f.dem",
MAPS_CACHE_DIR,
(gint) j,
floor(i*8)/8,
floor(j*8)/8 );
- if ( access(buf, F_OK ) == 0 ) {
+ if ( g_file_test(buf, G_FILE_TEST_EXISTS ) == TRUE ) {
VikCoord ne, sw;
gint x1, y1, x2, y2;
sw.north_south = i;
*/
static gboolean dem_layer_add_file ( VikDEMLayer *vdl, const gchar *full_path )
{
- if ( access(full_path, F_OK ) == 0 ) {
- /* only load if file size is not 0 (not in progress */
+ if ( g_file_test(full_path, G_FILE_TEST_EXISTS ) == TRUE ) {
+ /* only load if file size is not 0 (not in progress) */
struct stat sb;
stat (full_path, &sb);
if ( sb.st_size ) {
gchar *duped_path = g_strdup(full_path);
vdl->files = g_list_prepend ( vdl->files, duped_path );
a_dems_load ( duped_path );
- g_warning(duped_path);
+ g_debug("%s: %s", __FUNCTION__, duped_path);
vik_layer_emit_update ( VIK_LAYER(vdl) );
}
return TRUE;
full_path = g_strdup_printf("%s%s", MAPS_CACHE_DIR, dem_file );
- g_warning(full_path);
+ g_debug("%s: %s", __FUNCTION__, full_path);
// TODO: check if already in filelist