[Scummvm-devel] save, theme and extra paths!
Max Horn
max at quendi.de
Tue Feb 24 04:18:46 CET 2009
Am 23.02.2009 um 15:28 schrieb sunmax at libero.it:
> Hi there,
Hi.
> what's the correct way of handling misc paths?
>
> I mean "save", "theme", "extra" that you can set
> from Launcher->Options->Paths.
>
> On PS2 they default to "/foo/bar", "None", "None"
> which I see it's happening cause whem the button
> is created their key in ConfMan in not set.
Setting the default savepath is responsibility of the porter. This is
only necessary if your ports allows changing the savepath to another
location, though.
In that case, you also must provide a default value for the savepath
(ideally in the constructor of your SaveFileManager):
ConfMan.registerDefault("savepath", DEFAULT_SAVE_PATH);
And furthermore, your SaveFileManager must of course honor the current
"savepath" config setting.
Look at the POSIX and PSP SaveFileManagers for examples.
But as far as I can tell, the Ps2SaveFileManager doesn't use the
savepath value at all, so unless you rewrote it and haven't commited
the new code yet, you can change the savepath as much as you want and
it won't work :-).
> Now:
>
> a) if I try to set them from the GUI (eg. push on
> "Save Path:", select the path from the filebrowser
> and then "Choose") I can see the path selected.
>
> But then if I push on "OK" (which takes me out of
> the "Paths" dialog), and then get back to Paths,
> I see it has been discarded. Ditto for "Theme"
> and "Extra"
That sounds like a bug in your FSNode implementation then (possibly
caused by its documentation not being good enough, mind you ;-). Your
other mails seem to suggest that, too.
>
>
> b) if I try to set them in the code, eg.
>
> ConfMan.registerDefault("themepath", "host:themes/");
>
> They are disregarded as well.
That's odd. Are you sure that path is valid and that your FSNode class
is correctly instantiated for it? Our code does something like this to
turn the themepath into an FSNode:
Common::FSNode(ConfMan.get("themepath"))
can you verify that a valid FSNode is created from that?
>
>
> Am I missing something?
Yes :-)
Max
More information about the Scummvm-devel
mailing list