[anjuta] symbol-db: force db to be recreated if no version is detected or it is in a bad status.



commit 8cd354832f5381ae82230f5a7547c27d58834bec
Author: Massimo Corà <mcora src gnome org>
Date:   Thu Jan 6 02:24:00 2011 +0100

    symbol-db: force db to be recreated if no version is detected or it is in a bad status.

 plugins/symbol-db/symbol-db-engine-core.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/plugins/symbol-db/symbol-db-engine-core.c b/plugins/symbol-db/symbol-db-engine-core.c
index d6e0ae3..2c1a921 100644
--- a/plugins/symbol-db/symbol-db-engine-core.c
+++ b/plugins/symbol-db/symbol-db-engine-core.c
@@ -2502,14 +2502,13 @@ sdb_engine_check_db_version_and_upgrade (SymbolDBEngine *dbe,
 	if (version <= 0) 
 	{
 		/* some error occurred */
-		g_warning ("No version of db detected. This can produce many errors.");
-		return FALSE;
+		g_warning ("No version of db detected. This can produce many errors. DB"
+		           "will be recreated from scratch.");
+
+		/* force version to 0 */
+		version = 0;
 	}
-	
-	/* FIXME: in the future versions, if the changes grow up, add a better 
-	 * automatic upgrading system. Deleting & recreating the db is anyway
-	 * the best option to do.
-	 */
+		
 	if (version < atof (SYMBOL_DB_VERSION))
 	{
 		DEBUG_PRINT	 ("Upgrading from version %f to "SYMBOL_DB_VERSION, version);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]