AUDIT: r21459 - gnucash/trunk/src - Handle specifying a directory as a dataset file.

John Ralls jralls at code.gnucash.org
Tue Oct 18 20:03:00 EDT 2011


Author: jralls
Date: 2011-10-18 20:02:59 -0400 (Tue, 18 Oct 2011)
New Revision: 21459
Trac: http://svn.gnucash.org/trac/changeset/21459

Modified:
   gnucash/trunk/src/gnome-utils/dialog-file-access.c
   gnucash/trunk/src/gnome-utils/gnc-file.c
   gnucash/trunk/src/libqof/qof/qofsession.c
Log:
Handle specifying a directory as a dataset file.

The file chooser dialog would return a directory if the user selected
one and clicked "Open"; then, or if the users specified a directory on
the command line, Gnucash would present the rather misleading error "No
backend found".

So, first, if the user selects a directory and clicks open, the chooser
will now open the directory for browsing, just as if she had
double-clicked on the directory name in the tree view.

Next, if a directory is presented to qof_session_begin it will detect
that and set ERR_BACKEND_BAD_URL, which gnc_post_file_open will detect
and re-present the file chooser, open to that directory. (To prevent
confusion, gnc_post_file_open will put up the error dialog for BAD_URL;
the new file chooser dialog will open after that's dismissed. Since
there are other possible causes of a BAD_URL, if the filename isn't a
directory the chooser will open to the registered default directory from
GConf.)

BP



More information about the gnucash-patches mailing list