Showing with 49 additions and 13 deletions.
  1. +1 −0 cmake_templates/qgsconfig.h.in
  2. +1 −1 i18n/qgis_de.ts
  3. +1 −2 src/core/qgsapplication.h
  4. +37 −1 src/core/qgscoordinatereferencesystem.cpp
  5. +7 −7 src/crssync/main.cpp
  6. +2 −2 src/providers/gdal/qgsgdaldataitems.cpp
1 change: 1 addition & 0 deletions cmake_templates/qgsconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
//reinstate this more generic approach below at some point though
//#define VERSION_INT ${CPACK_PACKAGE_VERSION_MAJOR}${CPACK_PACKAGE_VERSION_MINOR}${CPACK_PACKAGE_VERSION_PATCH}
#define VERSION_INT ${QGIS_VERSION_INT}
#define ABISYM(x) x ## ${QGIS_VERSION_INT}
//used in main.cpp and anywhere else where the release name is needed
#define RELEASE_NAME "${RELEASE_NAME}"

Expand Down
2 changes: 1 addition & 1 deletion i18n/qgis_de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14342,7 +14342,7 @@ Sollen die vorhandenen Klassen vor der Klassifizierung gelöscht werden?</transl
<message>
<location filename="../src/ui/qgscompositionwidgetbase.ui" line="333"/>
<source>Selection tolerance (mm) </source>
<translation>Auswahltoleranz (mm)</translation>
<translation>Auswahltoleranz (mm) </translation>
</message>
<message>
<location filename="../src/ui/qgscompositionwidgetbase.ui" line="254"/>
Expand Down
3 changes: 1 addition & 2 deletions src/core/qgsapplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
#include <QStringList>

#include <qgis.h>

#define ABISYM(x) x ## VERSION_INT
#include <qgsconfig.h>

/** \ingroup core
* Extends QApplication to provide access to QGIS specific resources such
Expand Down
38 changes: 37 additions & 1 deletion src/core/qgscoordinatereferencesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1773,9 +1773,16 @@ int QgsCoordinateReferenceSystem::syncDb()
{
deleted = sqlite3_changes( database );
}
else
{
errors++;
qCritical( "Could not execute: %s [%s]\n",
sql.toLocal8Bit().constData(),
sqlite3_errmsg( database ) );
}

#if !defined(PJ_VERSION) || PJ_VERSION!=470
sql = QString( "select auth_name,auth_id,parameters from tbl_srs WHERE auth_name<>'EPSG' WHERE NOT deprecated" );
sql = QString( "select auth_name,auth_id,parameters from tbl_srs WHERE auth_name<>'EPSG' AND NOT deprecated" );
if ( sqlite3_prepare( database, sql.toAscii(), sql.size(), &select, &tail ) == SQLITE_OK )
{
while ( sqlite3_step( select ) == SQLITE_ROW )
Expand Down Expand Up @@ -1806,6 +1813,28 @@ int QgsCoordinateReferenceSystem::syncDb()
proj4 = proj4.mid( input.size() );
proj4 = proj4.trimmed();
}

if ( proj4 != params )
{
sql = QString( "UPDATE tbl_srs SET parameters=%1 WHERE auth_name=%2 AND auth_id=%3" )
.arg( quotedValue( proj4 ) )
.arg( quotedValue( auth_name ) )
.arg( quotedValue( auth_id ) );

if ( sqlite3_exec( database, sql.toUtf8(), 0, 0, &errMsg ) == SQLITE_OK )
{
updated++;
QgsDebugMsgLevel( QString( "SQL: %1\n OLD:%2\n NEW:%3" ).arg( sql ).arg( params ).arg( proj4 ), 3 );
}
else
{
qCritical( "Could not execute: %s [%s/%s]\n",
sql.toLocal8Bit().constData(),
sqlite3_errmsg( database ),
errMsg ? errMsg : "(unknown error)" );
errors++;
}
}
}
else
{
Expand All @@ -1820,6 +1849,13 @@ int QgsCoordinateReferenceSystem::syncDb()
pj_free( pj );
}
}
else
{
errors++;
qCritical( "Could not execute: %s [%s]\n",
sql.toLocal8Bit().constData(),
sqlite3_errmsg( database ) );
}
#endif

OSRDestroySpatialReference( crs );
Expand Down
14 changes: 7 additions & 7 deletions src/crssync/main.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/***************************************************************************
crssync.cpp
sync srs.db with proj
-------------------
begin : 2011
copyright : (C) 2011 by Juergen E. Fischer, norBIT GmbH
email : jef at norbit dot de
crssync.cpp
sync srs.db with proj
-------------------
begin : May 2011
copyright : (C) 2011 by Juergen E. Fischer, norBIT GmbH
email : jef at norbit dot de
***************************************************************************/

/***************************************************************************
Expand Down Expand Up @@ -46,7 +46,7 @@ int main( int argc, char ** argv )
QgsApplication::setPrefixPath( prefixPath ? prefixPath : CMAKE_INSTALL_PREFIX, TRUE );
}

std::cout << "Synchronizing CRS database with PROJ definitions." << std::endl;
std::cout << "Synchronizing CRS database with GDAL/PROJ definitions." << std::endl;

CPLPushErrorHandler( showError );

Expand Down
4 changes: 2 additions & 2 deletions src/providers/gdal/qgsgdaldataitems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,8 @@ QWidget * QgsWCSRootItem::paramWidget()
QgsWCSSourceSelect *select = new QgsWCSSourceSelect( 0, 0, true, true );
connect( select, SIGNAL( connectionsChanged() ), this, SLOT( connectionsChanged() ) );
return select;
return 0;
}

void QgsWCSRootItem::connectionsChanged()
{
refresh();
Expand All @@ -389,7 +389,7 @@ static QStringList wildcards = QStringList();

QGISEXTERN int dataCapabilities()
{
return QgsDataProvider::File | QgsDataProvider::Dir | QgsDataProvider::Net;
return QgsDataProvider::File | QgsDataProvider::Dir | QgsDataProvider::Net;
}

QGISEXTERN QgsDataItem * dataItem( QString thePath, QgsDataItem* parentItem )
Expand Down