When the server reported that there is no newer version available,
update the mtime of our local copy. This avoids having to recheck the
tile over and over again, when scrolling over an area multiple times.

Signed-off-by: Sven Wegener <sven.wege...@stealer.net>
---
 src/download.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/download.c b/src/download.c
index 1fabbf5..1c8994f 100644
--- a/src/download.c
+++ b/src/download.c
@@ -190,9 +190,10 @@ static int download( const char *hostname, const char 
*uri, const char *fn, Down
     return -1;
   }
 
-  if (ret == DOWNLOAD_NO_NEWER_FILE)
+  if (ret == DOWNLOAD_NO_NEWER_FILE)  {
     g_remove ( tmpfilename );
-  else
+    utimes ( fn, NULL ); /* update mtime of local copy */
+  } else
     g_rename ( tmpfilename, fn ); /* move completely-downloaded file to 
permanent location */
   unlock_file ( tmpfilename );
   g_free ( tmpfilename );
-- 
1.6.6


------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Viking-devel mailing list
Viking-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viking-devel
Viking home page: http://viking.sf.net/

Reply via email to