This repository has been archived on 2019-08-07. You can view files and clone it, but cannot push or open issues or pull requests.
copr-dani-qgis/qgis-1.4.0-asslibqgisv.patch

46 lines
1.9 KiB
Diff

--- /src/core/qgscoordinatereferencesystem.cpp 2010-06-07 21:40:15.448733536 +0200
+++ qgscoordinatereferencesystem.cpp.patched 2010-06-07 22:05:03.340736906 +0200
@@ -31,7 +31,6 @@
#include "qgsmessageoutput.h"
#include "qgis.h" //const vals declared here
-#include <cassert>
#include <sqlite3.h>
//gdal and ogr includes (needed for == operator)
@@ -1127,7 +1126,7 @@
// close the database
sqlite3_close( db );
- //assert(myProjString.length() > 0);
+ //Q_ASSERT(myProjString.length() > 0);
return myProjString;
}
@@ -1238,10 +1237,10 @@
myResult = sqlite3_open( QgsApplication::qgisUserDbFilePath().toUtf8().data(), &myDatabase );
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 ) );
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
@@ -1263,9 +1262,7 @@
if ( myResult != SQLITE_OK )
{
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
QString mySql = "select count(*) from tbl_srs";