Index: /trunk/qgis/src/core/qgscoordinatereferencesystem.cpp =================================================================== --- qgis-1.4.0/src/core/qgscoordinatereferencesystem.cpp (revision 13307) +++ /trunk/qgis/src/core/qgscoordinatereferencesystem.cpp (revision 13508) @@ -32,5 +32,4 @@ #include "qgis.h" //const vals declared here -#include #include @@ -1146,5 +1145,5 @@ sqlite3_close( db ); - //assert(myProjString.length() > 0); + //Q_ASSERT(myProjString.length() > 0); return myProjString; } @@ -1260,10 +1259,8 @@ if ( myResult != SQLITE_OK ) { - QgsDebugMsg( QString( "Can't open database: %1 \n please notify QGIS developers of this error \n %2 (file name) " ) - .arg( sqlite3_errmsg( myDatabase ) ) - .arg( QgsApplication::qgisUserDbFilePath() ) ); - // XXX This will likely never happen since on open, sqlite creates the - // database if it does not exist. - assert( myResult == SQLITE_OK ); + QgsDebugMsg( QString( "Can't open or create database %1: %2" ) + .arg( QgsApplication::qgisUserDbFilePath() ) + .arg( sqlite3_errmsg( myDatabase ) ) ); + return false; } QgsDebugMsg( QString( "Update or insert sql \n%1" ).arg( mySql ) ); @@ -1286,7 +1283,5 @@ { QgsDebugMsg( QString( "Can't open database: %1" ).arg( sqlite3_errmsg( myDatabase ) ) ); - // XXX This will likely never happen since on open, sqlite creates the - // database if it does not exist. - assert( myResult == SQLITE_OK ); + return 0; } // Set up the query to retrieve the projection information needed to populate the ELLIPSOID list