Skip to content
Permalink
Browse files

[bugfix] Bookmarks fix export SRID and refresh on import

Fixes #17674 - Export and Import problems after recent fixes
  • Loading branch information
elpaso committed Dec 13, 2017
1 parent 353ca63 commit 28a61e1e1d0eddf0db5dc88d79a743fbfa36e390
Showing with 11 additions and 1 deletion.
  1. +11 −1 src/app/qgsbookmarks.cpp
@@ -340,6 +340,7 @@ void QgsBookmarks::importFromXml()
}
mQgisModel->setSort( 0, Qt::AscendingOrder );
mQgisModel->select();
mProxyModel->_resetModel();
}

void QgsBookmarks::exportToXml()
@@ -388,8 +389,17 @@ void QgsBookmarks::exportToXml()
if ( idx.isValid() )
{
QString value = idx.data( Qt::DisplayRole ).toString();
QDomText idText = doc.createTextNode( value );
QString header = headerList.at( j );
// If it's the EPSG code, convert it to internal srid
if ( header == QStringLiteral( "sr_id" ) )
{
QgsCoordinateReferenceSystem crs;
if ( crs.createFromOgcWmsCrs( value ) )
value = QString::number( QgsCoordinateReferenceSystem::fromOgcWmsCrs( value ).srsid( ) );
else
value = QString();
}
QDomText idText = doc.createTextNode( value );
QDomElement id = doc.createElement( header );
id.appendChild( idText );
bookmark.appendChild( id );

0 comments on commit 28a61e1

Please sign in to comment.
You can’t perform that action at this time.