Skip to content

Commit d616bf4

Browse files
committedJun 16, 2014
restore export functionality in RoadGraph (fix #8695)
1 parent 85b8e10 commit d616bf4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed
 

‎src/plugins/roadgraph/exportdlg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ QgsVectorLayer* RgExportDlg::mapLayer() const
8383
return NULL;
8484

8585
QList<QgsField> attrList;
86-
attrList.append( QgsField( "one", QVariant::Int ) );
86+
attrList.append( QgsField( "id", QVariant::Int ) );
8787
prov->addAttributes( attrList );
8888
QList<QgsMapLayer *> myList;
8989
myList << myLayer;

‎src/plugins/roadgraph/shortestpathwidget.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include <qgsfeature.h>
3838
#include <qgsapplication.h>
3939
#include <qgsvectorlayer.h>
40+
#include <qgsvectordataprovider.h>
4041
#include <qgsmessagebar.h>
4142

4243
#include <qgsgraphdirector.h>
@@ -400,10 +401,11 @@ void RgShortestPathWidget::exportPath()
400401
}
401402
p.push_front( ct.transform( p1 ) );
402403

403-
vl->startEditing();
404404
QgsFeature f;
405+
QgsFeatureList features;
405406
f.setGeometry( QgsGeometry::fromPolyline( p ) );
406-
vl->addFeature( f );
407+
features << f;
408+
vl->dataProvider()->addFeatures( features );
407409
vl->updateExtents();
408410

409411
mPlugin->iface()->mapCanvas()->update();

0 commit comments

Comments
 (0)
Please sign in to comment.