Skip to content

Commit

Permalink
[bookmark] fix translation string: fixes to avoid an empty bookmark n…
Browse files Browse the repository at this point in the history
…ame on import when system locale is different from english
  • Loading branch information
slarosa committed Feb 24, 2015
1 parent 2e3baa7 commit 6dda391
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/app/qgsbookmarks.cpp
Expand Up @@ -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,"
Expand Down

2 comments on commit 6dda391

@nyalldawson
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Please sign in to comment.