[Rawstudio-commit] r3023 - branches/rawstudio-ng-color/src

Anders Kvist anders at kvistmail.dk
Sun Jan 17 21:04:37 CET 2010


Author: akv
Date: 2010-01-17 21:04:36 +0100 (Sun, 17 Jan 2010)
New Revision: 3023

Modified:
   branches/rawstudio-ng-color/src/rs-library.c
Log:
Checking if library.identifier exists during creation of version table. We need to set version to 0 if not - so it will be created in library_check_version().

Modified: branches/rawstudio-ng-color/src/rs-library.c
===================================================================
--- branches/rawstudio-ng-color/src/rs-library.c	2010-01-17 01:58:32 UTC (rev 3022)
+++ branches/rawstudio-ng-color/src/rs-library.c	2010-01-17 20:04:36 UTC (rev 3023)
@@ -287,6 +287,16 @@
 		rc = sqlite3_bind_int(stmt, 1, LIBRARY_VERSION);
 		rc = sqlite3_step(stmt);
 		sqlite3_finalize(stmt);
+
+		rc = sqlite3_prepare_v2(db, "select identifier from library", -1, &stmt, NULL);
+		rc = sqlite3_step(stmt);
+		sqlite3_finalize(stmt);
+
+		/* Check if library.identifier exists */
+		if (rc == SQLITE_MISUSE)
+		{
+			library_set_version(db, 0);
+		}
 	}
 
 	return SQLITE_OK;




More information about the Rawstudio-commit mailing list