r19807 - gnucash/trunk/src/gnc - Cutecash: Adapt to changed session_begin in r19798.

Christian Stimming cstim at code.gnucash.org
Sun Nov 14 08:16:31 EST 2010


Author: cstim
Date: 2010-11-14 08:16:31 -0500 (Sun, 14 Nov 2010)
New Revision: 19807
Trac: http://svn.gnucash.org/trac/changeset/19807

Modified:
   gnucash/trunk/src/gnc/Session.hpp
   gnucash/trunk/src/gnc/mainwindow-file.cpp
Log:
Cutecash: Adapt to changed session_begin in r19798.

Modified: gnucash/trunk/src/gnc/Session.hpp
===================================================================
--- gnucash/trunk/src/gnc/Session.hpp	2010-11-14 13:05:43 UTC (rev 19806)
+++ gnucash/trunk/src/gnc/Session.hpp	2010-11-14 13:16:31 UTC (rev 19807)
@@ -58,9 +58,9 @@
 
     // Now the actual functions on the object
 
-    void begin(const QString& book_id, bool ignore_lock, bool create_if_nonexistent)
+    void begin(const QString& book_id, bool ignore_lock, bool create_if_nonexistent, bool force)
     {
-        qof_session_begin(get(), book_id.toUtf8(), ignore_lock, create_if_nonexistent);
+        qof_session_begin(get(), book_id.toUtf8(), ignore_lock, create_if_nonexistent, force);
     }
     void load (QofPercentageFunc percentage_func)
     {
@@ -94,10 +94,6 @@
     {
         return qof_session_save_in_progress(get());
     }
-    bool save_may_clobber_data () const
-    {
-        return qof_session_save_may_clobber_data(get());
-    }
     void save (QofPercentageFunc percentage_func)
     {
         qof_session_save(get(), percentage_func);

Modified: gnucash/trunk/src/gnc/mainwindow-file.cpp
===================================================================
--- gnucash/trunk/src/gnc/mainwindow-file.cpp	2010-11-14 13:05:43 UTC (rev 19806)
+++ gnucash/trunk/src/gnc/mainwindow-file.cpp	2010-11-14 13:16:31 UTC (rev 19807)
@@ -382,7 +382,7 @@
     QofSession *new_session = qof_session_new ();
 
     bool we_are_in_error = false;
-    qof_session_begin (new_session, newfile, FALSE, FALSE);
+    qof_session_begin (new_session, newfile, FALSE, FALSE, FALSE);
     QofBackendError io_err = qof_session_get_error (new_session);
     /* if file appears to be locked, ask the user ... */
     if (ERR_BACKEND_LOCKED == io_err || ERR_BACKEND_READONLY == io_err)
@@ -407,7 +407,7 @@
         if (msgBox.clickedButton() == openAnyway)
         {
             /* user told us to ignore locks. So ignore them. */
-            qof_session_begin (new_session, newfile, TRUE, FALSE);
+            qof_session_begin (new_session, newfile, TRUE, FALSE, FALSE);
         }
         else if (msgBox.clickedButton() == createNewFile)
         {
@@ -432,7 +432,7 @@
         if (false == show_session_error (this, io_err, newfile, GNC_FILE_DIALOG_OPEN))
         {
             /* user told us to create a new database. Do it. */
-            qof_session_begin (new_session, newfile, FALSE, TRUE);
+            qof_session_begin (new_session, newfile, FALSE, TRUE, FALSE);
         }
     }
 
@@ -597,7 +597,7 @@
 
     save_in_progress++;
     QofSession *new_session = qof_session_new ();
-    qof_session_begin (new_session, newfile, FALSE, FALSE);
+    qof_session_begin (new_session, newfile, FALSE, FALSE, FALSE);
 
     QofBackendError io_err = qof_session_get_error (new_session);
 
@@ -607,7 +607,7 @@
         if (false == show_session_error (this, io_err, newfile, GNC_FILE_DIALOG_SAVE))
         {
             /* user told us to ignore locks. So ignore them. */
-            qof_session_begin (new_session, newfile, TRUE, FALSE);
+            qof_session_begin (new_session, newfile, TRUE, FALSE, FALSE);
         }
     }
 
@@ -619,7 +619,7 @@
         if (false == show_session_error (this, io_err, newfile, GNC_FILE_DIALOG_SAVE))
         {
             /* user told us to create a new database. Do it. */
-            qof_session_begin (new_session, newfile, FALSE, TRUE);
+            qof_session_begin (new_session, newfile, FALSE, TRUE, FALSE);
         }
     }
 
@@ -639,7 +639,9 @@
     }
 
     /* oops ... file already exists ... ask user what to do... */
-    if (qof_session_save_may_clobber_data (new_session))
+    if (false) //qof_session_save_may_clobber_data (new_session))
+        // FIXME: Need to copy the other implementation from r19798 in
+        // gnc-file.c for overwrite-on-existing-file.
     {
         if (QMessageBox::question(this, tr("File Exists"),
                                   tr("The file %1 already exists. "



More information about the gnucash-changes mailing list