]> git.street.me.uk Git - andy/viking.git/blobdiff - src/vikmapniklayer.c
Only call gps_close() after a successful gps_open().
[andy/viking.git] / src / vikmapniklayer.c
index 49b3060688fcc5c7d50de2628da030d2608916e2..38587d14ec674df3038abab29a0e9bbce482bfe5 100644 (file)
 
 #include "vikmapslayer.h"
 
-#if !GLIB_CHECK_VERSION(2,26,0)
-typedef struct stat GStatBuf;
-#endif
-
 struct _VikMapnikLayerClass
 {
        VikLayerClass object_class;
@@ -543,6 +539,7 @@ gboolean carto_load ( VikMapnikLayer *vml, VikViewport *vvp )
                                if ( !g_strcmp0 ( vml->filename_xml, vml->filename_css ) ) {
                                        vml->filename_xml = g_strconcat ( vml->filename_css, ".xml", NULL );
                                }
+                               g_regex_unref ( regex );
                        }
                        if ( !g_file_set_contents (vml->filename_xml, mystdout, -1, &error)  ) {
                                g_warning ("%s: %s", __FUNCTION__, error->message );
@@ -637,7 +634,8 @@ static void possibly_save_pixbuf ( VikMapnikLayer *vml, GdkPixbuf *pixbuf, MapCo
 
                        gchar *dir = g_path_get_dirname ( filename );
                        if ( !g_file_test ( filename, G_FILE_TEST_EXISTS ) )
-                               g_mkdir_with_parents ( dir , 0777 );
+                               if ( g_mkdir_with_parents ( dir , 0777 ) != 0 )
+                                       g_warning ("%s: Failed to mkdir %s", __FUNCTION__, dir );
                        g_free ( dir );
 
                        if ( !gdk_pixbuf_save (pixbuf, filename, "png", &error, NULL ) ) {
@@ -717,7 +715,7 @@ static void render_cancel_cleanup (RenderInfo *data)
 /**
  * Thread
  */
-void thread_add (VikMapnikLayer *vml, MapCoord *mul, VikCoord *ul, VikCoord *br, gint x, gint y, gint z, gint zoom, const gchar* name )
+static void thread_add (VikMapnikLayer *vml, MapCoord *mul, VikCoord *ul, VikCoord *br, gint x, gint y, gint z, gint zoom, const gchar* name )
 {
        // Create request
        guint nn = name ? g_str_hash ( name ) : 0;
@@ -1095,7 +1093,7 @@ static void mapnik_layer_tile_info ( VikMapnikLayer *vml )
        if ( g_file_test ( filename, G_FILE_TEST_EXISTS ) ) {
                filemsg = g_strconcat ( "Tile File: ", filename, NULL );
                // Get some timestamp information of the tile
-               struct stat stat_buf;
+               GStatBuf stat_buf;
                if ( g_stat ( filename, &stat_buf ) == 0 ) {
                        gchar time_buf[64];
                        strftime ( time_buf, sizeof(time_buf), "%c", gmtime((const time_t *)&stat_buf.st_mtime) );