Skip to content

Commit

Permalink
Fix new bookmark query. Fix #16465
Browse files Browse the repository at this point in the history
QSqlQuery was returning an error : wrong parameters count.
It seems that bindValue was having no effect (no bounded values).
Using prepare after construction seems to solve the problem.
  • Loading branch information
arnaud-morvan committed Apr 30, 2017
1 parent b3e1aba commit aea2130
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/qgsbookmarks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ void QgsBookmarks::addClicked()
QgsMapCanvas *canvas = QgisApp::instance()->mapCanvas();
Q_ASSERT( canvas );

QSqlQuery query( "INSERT INTO tbl_bookmarks(bookmark_id,name,project_name,xmin,ymin,xmax,ymax,projection_srid)"
" VALUES (NULL,:name,:project_name,:xmin,:xmax,:ymin,:ymax,:projection_srid)",
mQgisModel->database() );
QSqlQuery query( mQgisModel->database() );
query.prepare( "INSERT INTO tbl_bookmarks(bookmark_id,name,project_name,xmin,ymin,xmax,ymax,projection_srid)"
" VALUES (NULL,:name,:project_name,:xmin,:xmax,:ymin,:ymax,:projection_srid)" );

QString projStr( QLatin1String( "" ) );
if ( QgsProject::instance() )
Expand Down

0 comments on commit aea2130

Please sign in to comment.