Skip to content

Commit

Permalink
restore export functionality in RoadGraph (fix #8695)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Jun 16, 2014
1 parent 85b8e10 commit d616bf4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/plugins/roadgraph/exportdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ QgsVectorLayer* RgExportDlg::mapLayer() const
return NULL;

QList<QgsField> attrList;
attrList.append( QgsField( "one", QVariant::Int ) );
attrList.append( QgsField( "id", QVariant::Int ) );
prov->addAttributes( attrList );
QList<QgsMapLayer *> myList;
myList << myLayer;
Expand Down
6 changes: 4 additions & 2 deletions src/plugins/roadgraph/shortestpathwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <qgsfeature.h>
#include <qgsapplication.h>
#include <qgsvectorlayer.h>
#include <qgsvectordataprovider.h>
#include <qgsmessagebar.h>

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

vl->startEditing();
QgsFeature f;
QgsFeatureList features;
f.setGeometry( QgsGeometry::fromPolyline( p ) );
vl->addFeature( f );
features << f;
vl->dataProvider()->addFeatures( features );
vl->updateExtents();

mPlugin->iface()->mapCanvas()->update();
Expand Down

0 comments on commit d616bf4

Please sign in to comment.