Skip to content
Permalink
Browse files

[bookmark] fix translation string: fixes to avoid an empty bookmark n…

…ame on import when system locale is different from english
  • Loading branch information
slarosa committed Feb 24, 2015
1 parent 2e3baa7 commit 6dda391be4a1a745a9b09591bd4f7d8f21856893
Showing with 7 additions and 7 deletions.
  1. +7 −7 src/app/qgsbookmarks.cpp
@@ -296,13 +296,13 @@ void QgsBookmarks::importFromXML()
for ( int i = 0;i < nodeList.count(); i++ )
{
QDomNode bookmark = nodeList.at( i );
QDomElement name = bookmark.firstChildElement( "Name" );
QDomElement prjname = bookmark.firstChildElement( "Project" );
QDomElement xmin = bookmark.firstChildElement( "xMin" );
QDomElement xmax = bookmark.firstChildElement( "xMax" );
QDomElement ymin = bookmark.firstChildElement( "yMin" );
QDomElement ymax = bookmark.firstChildElement( "yMax" );
QDomElement srid = bookmark.firstChildElement( "SRID" );
QDomElement name = bookmark.firstChildElement( tr( "Name" ) );
QDomElement prjname = bookmark.firstChildElement( tr( "Project" ) );
QDomElement xmin = bookmark.firstChildElement( tr( "xMin" ) );
QDomElement xmax = bookmark.firstChildElement( tr( "xMax" ) );
QDomElement ymin = bookmark.firstChildElement( tr( "yMin" ) );
QDomElement ymax = bookmark.firstChildElement( tr( "yMax" ) );
QDomElement srid = bookmark.firstChildElement( tr( "SRID" ) );

queries += "INSERT INTO tbl_bookmarks(bookmark_id,name,project_name,xmin,ymin,xmax,ymax,projection_srid)"
" VALUES (NULL,"

2 comments on commit 6dda391

@nyalldawson

This comment has been minimized.

Copy link
Collaborator

@nyalldawson nyalldawson replied Feb 24, 2015

@slarosa Why are these values being translated? Doesn't that make the resultant file language-specific and breakable if a translation changes? I think a better approach would be to modify QgsBookmarks::exportToXML so that it uses preset values rather than the column headers (possibly could be done by storing fixed element names in a user role in the model header data).

@slarosa

This comment has been minimized.

Copy link
Member Author

@slarosa slarosa replied Feb 25, 2015

@nyalldawson ...right, could the following patch be a solution?
https://gist.github.com/slarosa/d6ef8828d1f0b5edd1ed

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