Add Gnucash svn version to sql versions table.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19920 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
John Ralls
2010-12-10 00:05:30 +00:00
parent d33ac38371
commit ccba29be5e
3 changed files with 18 additions and 0 deletions
+8
View File
@@ -73,6 +73,8 @@
#include "gnc-tax-table-sql.h"
#include "gnc-vendor-sql.h"
#include "gnc-main.h"
#if defined( S_SPLINT_S )
#include "splint-defs.h"
#endif
@@ -482,6 +484,7 @@ gnc_sql_sync_all( GncSqlBackend* be, /*@ dependent @*/ QofBook *book )
ENTER( "book=%p, primary=%p", book, be->primary_book );
(void)reset_version_info( be );
gnc_sql_set_table_version( be, "Gnucash", gnc_get_svn_version() );
/* Create new tables */
be->is_pristine_db = TRUE;
@@ -593,6 +596,7 @@ gnc_sql_commit_edit( GncSqlBackend *be, QofInstance *inst )
gboolean is_dirty;
gboolean is_destroying;
gboolean is_infant;
const gint gnc_version = gnc_get_svn_version();
g_return_if_fail( be != NULL );
g_return_if_fail( inst != NULL );
@@ -640,6 +644,10 @@ gnc_sql_commit_edit( GncSqlBackend *be, QofInstance *inst )
be_data.be = be;
be_data.inst = inst;
be_data.is_ok = TRUE;
/* Set/update the application version in the database */
if (gnc_sql_get_table_version( be, "Gnucash") != gnc_version )
gnc_sql_set_table_version( be, "Gnucash", gnc_version );
qof_object_foreach_backend( GNC_SQL_BACKEND, commit_cb, &be_data );
if ( !be_data.is_known )
+8
View File
@@ -21,8 +21,10 @@
* Boston, MA 02110-1301, USA gnu@gnu.org
*/
#include <stdlib.h>
#include "config.h"
#include "gnc-main.h"
#include "gnome-utils/gnc-version.h"
static gchar *namespace_regexp = NULL;
static gboolean is_debugging = 0;
@@ -80,3 +82,9 @@ gnc_get_gconf_path (void)
{
return gconf_path;
}
gint
gnc_get_svn_version (void)
{
return strtol(GNUCASH_SVN_REV, NULL, 10);
}
+2
View File
@@ -40,4 +40,6 @@ void gnc_set_extra(gboolean enabled);
void gnc_set_gconf_path(const gchar *prefix);
const gchar *gnc_get_gconf_path(void);
gint gnc_get_svn_version(void);
#endif /* GNC_MAIN_H */