r15870 - gnucash/trunk/src/gnome-utils - Bug#428452: use the g_path_get_dirname(...) of the last-file-opened to initialize the default directory of the File > Open dialog.

Josh Sled jsled at cvs.gnucash.org
Tue Apr 10 22:08:24 EDT 2007


Author: jsled
Date: 2007-04-10 22:08:23 -0400 (Tue, 10 Apr 2007)
New Revision: 15870
Trac: http://svn.gnucash.org/trac/changeset/15870

Modified:
   gnucash/trunk/src/gnome-utils/gnc-file.c
Log:
Bug#428452: use the g_path_get_dirname(...) of the last-file-opened to initialize the default directory of the File > Open dialog.


Modified: gnucash/trunk/src/gnome-utils/gnc-file.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-file.c	2007-04-10 22:43:16 UTC (rev 15869)
+++ gnucash/trunk/src/gnome-utils/gnc-file.c	2007-04-11 02:08:23 UTC (rev 15870)
@@ -832,15 +832,20 @@
 {
   const char * newfile;
   char *lastfile;
+  gchar *last_file_dir;
   gboolean result;
 
   if (!gnc_file_query_save (TRUE))
     return FALSE;
 
   lastfile = gnc_history_get_last();
-  newfile = gnc_file_dialog (_("Open"), NULL, lastfile, GNC_FILE_DIALOG_OPEN);
   if (lastfile)
+    last_file_dir = g_path_get_dirname(lastfile);
+  newfile = gnc_file_dialog (_("Open"), NULL, last_file_dir, GNC_FILE_DIALOG_OPEN);
+  if (lastfile != NULL)
     g_free(lastfile);
+  if (last_file_dir != NULL)
+    g_free(last_file_dir);
   result = gnc_post_file_open (newfile);
 
   /* This dialogue can show up early in the startup process. If the



More information about the gnucash-changes mailing list