[Gnucash-changes] r13357 - gnucash/trunk/src/gnome-utils - Avoid instantiating the current session until we're actually opening a file.

Chris Shoemaker chris at cvs.gnucash.org
Tue Feb 21 22:05:20 EST 2006


Author: chris
Date: 2006-02-21 22:05:20 -0500 (Tue, 21 Feb 2006)
New Revision: 13357
Trac: http://svn.gnucash.org/trac/changeset/13357

Modified:
   gnucash/trunk/src/gnome-utils/gnc-file.c
   gnucash/trunk/src/gnome-utils/gnc-main-window.c
Log:
   Avoid instantiating the current session until we're actually opening a file.


Modified: gnucash/trunk/src/gnome-utils/gnc-file.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-file.c	2006-02-22 02:43:20 UTC (rev 13356)
+++ gnucash/trunk/src/gnome-utils/gnc-file.c	2006-02-22 03:05:20 UTC (rev 13357)
@@ -532,6 +532,8 @@
 {
   GtkWidget *parent = gnc_ui_get_toplevel();
 
+  if (!gnc_current_session_exist())
+      return TRUE;
   /* If user wants to mess around before finishing business with
    * the old file, give em a chance to figure out what's up.  
    * Pose the question as a "while" loop, so that if user screws

Modified: gnucash/trunk/src/gnome-utils/gnc-main-window.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-main-window.c	2006-02-22 02:43:20 UTC (rev 13356)
+++ gnucash/trunk/src/gnome-utils/gnc-main-window.c	2006-02-22 03:05:20 UTC (rev 13357)
@@ -996,10 +996,11 @@
 {
   GncMainWindowPrivate *priv;
   GncPluginPage *page;
-  const gchar *filename;
+  const gchar *filename = NULL;
   gchar *title, *ptr;
 
-  filename = gnc_session_get_url (gnc_get_current_session ());
+  if (gnc_current_session_exist())
+      filename = gnc_session_get_url (gnc_get_current_session ());
 
   if (!filename)
     filename = _("<no file>");



More information about the gnucash-changes mailing list