having Marble find the right data files

Dirk Hohndel dirk at hohndel.org
Sat May 25 09:33:22 PDT 2013


On Fri, 2013-05-24 at 22:39 -0700, Dirk Hohndel wrote:
> One of the challenges with the Google Maps update to Marble that I just
> pushed is that it requires the user to move two directories to a
> specific spot in their home directory (on Linux - I haven't checked how
> this would work on Mac or Windows).
> 
> That's of course not a sustainable idea for a bundled application.
> 
> Marble supports a global variable named MarbleDataPath that allows us to
> set one (of two) search path for Marble to find its data files. What
> Marble doesn't support today is ':' separated multiple paths that it
> would search, but we can indeed set things up that Subsurface searches
> for the files and then sets up the MarbleDataPath accordingly.
> 
> I think we need to make these platform dependent functions that do
> something like this:
> 
> If subsurface is run from the local directory, then MarbleDataPath="."
> If subsurface is installed by make install (or as an application
> package), then MarbleDataPath is set to a system specific install
> directory (%executable_path%/../Resources/lib/marble or something like
> that on Mac).
> 
> I think we can do this in a clean and consistent way on all three OSs.

While reading the Marble sources (this is one poorly documented project
with no useful web presence and very few answers that I could find by
googling) I am beginning to worry about the quality of that code.

They don't actually support search paths. They mention this in the
comments as a feature they should add eventually... there are two
directories that things are looked for. One system directory
(/usr/share/apps/marble or something) and a local directory
(~/.local/share/marble). And all we can do is replace the system path
with a different one. But doing that means that Marble now no longer
finds lots of other files, for example its default icons. For most of
them that seems fine as I don't think lacking the icons for
"manned_landing", "robotic_rover", "unmanned_hard_landing" or the
various types of places of worship that Marble supports is necessarily a
big issues for Subsurface, but at least the default_location icon seemed
important. And since we now need to carry our own, I replaced the boring
circle with a tiny dive flag.

I pushed the hack that implements this, just to demonstrate how this
works. So with the latest master you no longer need to copy directories
around...

/D



More information about the subsurface mailing list