diff --git a/src/app/qgisapp.cpp b/src/app/qgisapp.cpp index f1fa485ab62..c63901cd79c 100644 --- a/src/app/qgisapp.cpp +++ b/src/app/qgisapp.cpp @@ -6343,6 +6343,9 @@ QgsVectorLayer *QgisApp::pasteToNewMemoryVector() QString typeName = QString( QGis::featureType( wkbType ) ).replace( "WKB", "" ); + static int pastedFeatureLayers = 0; + typeName += QString( "?memoryid=pasted_features%1" ).arg( ++pastedFeatureLayers ); + QgsDebugMsg( QString( "output wkbType = %1 typeName = %2" ).arg( wkbType ).arg( typeName ) ); QString message; diff --git a/src/gui/qgsnewmemorylayerdialog.cpp b/src/gui/qgsnewmemorylayerdialog.cpp index e8ecf1d2f2f..d394da0a01c 100644 --- a/src/gui/qgsnewmemorylayerdialog.cpp +++ b/src/gui/qgsnewmemorylayerdialog.cpp @@ -64,7 +64,8 @@ QgsVectorLayer *QgsNewMemoryLayerDialog::runAndCreateLayer( QWidget *parent ) geomType = "point"; } - QString layerProperties = geomType + QString( "?crs=%1" ).arg( crsId ); + static int createScratchLayers = 0; + QString layerProperties = QString( "%1?crs=%2&memoryid=scratchlayer%3" ).arg( geomType ).arg( crsId ).arg( ++createScratchLayers ); QString name = dialog.layerName().isEmpty() ? tr( "New scratch layer" ) : dialog.layerName(); QgsVectorLayer* newLayer = new QgsVectorLayer( layerProperties, name, QString( "memory" ) ); return newLayer; diff --git a/src/plugins/roadgraph/exportdlg.cpp b/src/plugins/roadgraph/exportdlg.cpp index 827d8cbc576..526a43db8df 100644 --- a/src/plugins/roadgraph/exportdlg.cpp +++ b/src/plugins/roadgraph/exportdlg.cpp @@ -76,7 +76,8 @@ QgsVectorLayer* RgExportDlg::mapLayer() const if ( layerId == QString( "-1" ) ) { // create a temporary layer - myLayer = new QgsVectorLayer( "LineString?crs=epsg:4326", "shortest path", "memory" ); + static int createdLayers = 0; + myLayer = new QgsVectorLayer( QString( "LineString?crs=epsg:4326&memoryid=rglayer%1" ).arg( ++createdLayers ), "shortest path", "memory" ); QgsVectorDataProvider *prov = myLayer->dataProvider(); if ( prov == NULL )