Database "filename" format

Christian Stimming stimming at
Tue Feb 23 15:20:28 EST 2010

Am Montag, 22. Februar 2010 schrieb Geert Janssens:
> Hi,
> I'm about to make some changes in the code that will normalize file and
> database names. Internally, they will all be converted to either one of
>  these internally:
> file://<path>
> xml://<path>
> sqlite3://<path>
> mysql://<user>:<pass>@<host>:<port>/<dbname>
> postgres://<user>:<pass>@<host>:<port>/<dbname>
> Whenever the user is to be shown a such a name, they will be transformed
>  into <path> (for file based data stores, in error messages eg during open
>  and save) <filename-only> (all other places, like history, title bar,...)

Sounds good. One caveat though: On Windows, the file paths might look 
unexpected: They might have the drive letter at the beginning, and they might 
have backslashes instead of slashes.

That is, a file path on windows can be written in any of the following forms:
/Temp/Bla.gnucash   # well, maybe not this one

The important point is that there is a colon in the path, so that the 
"protocol" (file,xml,sqlite3 et cetera) must not be confused with a drive 
letter. I think there were some glib functions around which can be used for 
checking whether there is a drive letter, but I forgot the details.

> Why:
> 1. consistent internal representation, which will make a number of
>  evaluations with the uri's more straighforward
> 2. more consistent user presentation. The file representation doesn't
>  change. This is what the user already sees in his file manager. The uri
>  form acc://user:pass@host:port/path on the other hand is common in other
>  remote access scenarios, like the web, ftp, ssh,...
> 3. Passwords shouldn't be user visible. There may be situations where
>  gnucash is used that require some password privacy. It's still stored in
>  gconf though. It would be better to store it in gnome-keyring, but that's
>  another issue (which I have just added in bugzilla, by the way:
> Any comments ?

All fine.



More information about the gnucash-devel mailing list