[Gnucash-changes] r14167 - gnucash/branches/misc-backend/src/gnome-utils - Use the session URL instead of file path for

Chris Shoemaker chris at cvs.gnucash.org
Tue May 23 23:44:51 EDT 2006


Author: chris
Date: 2006-05-23 23:44:50 -0400 (Tue, 23 May 2006)
New Revision: 14167
Trac: http://svn.gnucash.org/trac/changeset/14167

Modified:
   gnucash/branches/misc-backend/src/gnome-utils/gnc-file.c
   gnucash/branches/misc-backend/src/gnome-utils/gnc-main-window.c
Log:
   Use the session URL instead of file path for 
     1) determining if we have something open
     2) determining if we're saving exactly what we have open
     3) updating the title bar



Modified: gnucash/branches/misc-backend/src/gnome-utils/gnc-file.c
===================================================================
--- gnucash/branches/misc-backend/src/gnome-utils/gnc-file.c	2006-05-24 03:34:18 UTC (rev 14166)
+++ gnucash/branches/misc-backend/src/gnome-utils/gnc-file.c	2006-05-24 03:44:50 UTC (rev 14167)
@@ -960,7 +960,7 @@
   /* If we don't have a filename/path to save to get one. */
   session = gnc_get_current_session ();
 
-  if (!qof_session_get_file_path (session))
+  if (!qof_session_get_url(session))
   {
     gnc_file_save_as ();
     return;
@@ -977,10 +977,10 @@
 
   /* Make sure everything's OK - disk could be full, file could have
      become read-only etc. */
-  newfile = qof_session_get_file_path (session);
   io_err = qof_session_get_error (session);
   if (ERR_BACKEND_NO_ERR != io_err)
   {
+    newfile = qof_session_get_url(session);
     show_session_error (io_err, newfile, GNC_FILE_DIALOG_SAVE);
 
     if (been_here_before) return;
@@ -1035,7 +1035,7 @@
   }
 
   session = gnc_get_current_session ();
-  oldfile = qof_session_get_file_path (session);
+  oldfile = qof_session_get_url(session);
   if (oldfile && (strcmp(oldfile, newfile) == 0))
   {
     g_free (newfile);
@@ -1045,7 +1045,7 @@
 
   /* -- this session code is NOT identical in FileOpen and FileSaveAs -- */
 
-  xaccLogSetBaseName(newfile);
+  xaccLogSetBaseName(newfile); //FIXME: This is premature.
   save_in_progress++;
   new_session = qof_session_new ();
   qof_session_begin (new_session, newfile, FALSE, FALSE);
@@ -1136,7 +1136,7 @@
   gnc_set_busy_cursor (NULL, TRUE);
   session = gnc_get_current_session ();
 
-  /* disable events; otherwise the mass deletetion of accounts and
+  /* disable events; otherwise the mass deletion of accounts and
    * transactions during shutdown would cause massive redraws */
   qof_event_suspend ();
 

Modified: gnucash/branches/misc-backend/src/gnome-utils/gnc-main-window.c
===================================================================
--- gnucash/branches/misc-backend/src/gnome-utils/gnc-main-window.c	2006-05-24 03:34:18 UTC (rev 14166)
+++ gnucash/branches/misc-backend/src/gnome-utils/gnc-main-window.c	2006-05-24 03:44:50 UTC (rev 14167)
@@ -906,7 +906,7 @@
 
   session = gnc_get_current_session();
   book = qof_session_get_book(session);
-  filename = qof_session_get_file_path(session);
+  filename = qof_session_get_url(session);
   if (filename == NULL)
     filename = _("<unknown>");
   if ((tmp = strrchr(filename, '/')) != NULL)



More information about the gnucash-changes mailing list