The map cache default directory is dependent on the user and OS, however on 
reading in when it's blank it automatically puts in the map cache default 
directory.
---
 src/vikmapslayer.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/vikmapslayer.c b/src/vikmapslayer.c
index 40b3e67..6468637 100644
--- a/src/vikmapslayer.c
+++ b/src/vikmapslayer.c
@@ -466,7 +466,15 @@ static VikLayerParamData maps_layer_get_param ( 
VikMapsLayer *vml, guint16 id, g
   VikLayerParamData rv;
   switch ( id )
   {
-    case PARAM_CACHE_DIR: rv.s = vml->cache_dir ? vml->cache_dir : ""; break;
+    case PARAM_CACHE_DIR:
+      /* Only save a blank when the map cache location equals the default
+        On reading in, when it is blank then the default is reconstructed
+        Since the default changes dependent on the user and OS, it means the 
resultant file is more portable */
+      if ( is_file_operation && vml->cache_dir && strcmp ( vml->cache_dir, 
a_preferences_get(VIKING_PREFERENCES_NAMESPACE "maplayer_default_dir")->s ) == 
0 )
+       rv.s = "";
+      else
+       rv.s = vml->cache_dir ? vml->cache_dir : "";
+      break;
     case PARAM_MAPTYPE: rv.u = map_index_to_uniq_id ( vml->maptype ); break;
     case PARAM_ALPHA: rv.u = vml->alpha; break;
     case PARAM_AUTODOWNLOAD: rv.u = vml->autodownload; break;
-- 
1.7.1


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
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