> 2013/10/29 Robert Norris  
> <rw_nor...@hotmail.com<mailto:rw_nor...@hotmail.com>> 
> Then to support relative paths, change to the directory when opening a  
> .vik file but then simply return to the previous working directory  
> (which it does not do ATM) so there no unintentional side effects. 
>  
> I think/feel that playing with current working directory can have  
> hard-to-understand behaviors. I'm really not comfortable with such idea  
> as viking also uses more and more multi-threading. 

Luckily we're don't use multi thread to open files yet...
 
> What about simply modifying the code that compute the path of a file to  
> open from a .vik file? For example, using  
> g_path_is_absolute<https://developer.gnome.org/glib/2.37/glib-Miscellaneous-Utility-Functions.html#g-path-is-absolute>
>   
> to decide if the path is absolute or not and concat the dirname of the  
> .vik file if needed? 

Agreed that sounds like a better way of doing it.

In fact thinking about it further - my basic chdir() method is still broken, 
since when another chdir() kicks in - the relative paths against the previous 
location are now changed.**

So we always need to calculate the absolute path.
 
> If you describe/commit a use case (I'm not sure to finelly understand  
> the issue), I can try to do the change myself. 

See https://sourceforge.net/p/viking/feature-requests/78/

You should be able to understand this better than myself!

Primarily for having waypoint associated images relative to the .vik file

Thus you can then transfer (e.g. the directory containing) the .vik and images 
and then the .vik will would work on any other system and the thumbnails get 
shown properly. And of course opening the full image would work too.

See:
a_thumbnails_get()
&
trw_layer_show_picture()

**Brokenness above means the thumbnail generation should work after a 
subsequent chdir() since that is performed once but a Show Picture on previous 
relative location will not as it done on each request.

> --  
> Guilhem BONNEFILLE 
> -=- JID: gu...@im.apinc.org<mailto:gu...@im.apinc.org> MSN:  
> guilhem_bonnefi...@hotmail.com<mailto:guilhem_bonnefi...@hotmail.com> 
> -=- mailto:guilhem.bonnefi...@gmail.com<mailto:guilhem.bonnefi...@gmail.com> 
> -=- http://nathguil.free.fr/                                    
------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
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