Skip to content

Commit

Permalink
fix #2670
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13508 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed May 16, 2010
1 parent 2a55b8c commit 1549311
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/core/qgscoordinatereferencesystem.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -1145,7 +1144,7 @@ QString QgsCoordinateReferenceSystem::proj4FromSrsId( const int theSrsId )
// close the database
sqlite3_close( db );

//assert(myProjString.length() > 0);
//Q_ASSERT(myProjString.length() > 0);
return myProjString;
}

Expand Down Expand Up @@ -1259,12 +1258,10 @@ bool QgsCoordinateReferenceSystem::saveAsUserCRS()
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 );
Expand All @@ -1285,9 +1282,7 @@ long QgsCoordinateReferenceSystem::getRecordCount()
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";
Expand Down

0 comments on commit 1549311

Please sign in to comment.