diff --git a/providers/ogr/qgsogrprovider.cpp b/providers/ogr/qgsogrprovider.cpp index f2cce2564d0..af75a869ebf 100644 --- a/providers/ogr/qgsogrprovider.cpp +++ b/providers/ogr/qgsogrprovider.cpp @@ -25,6 +25,7 @@ email : sherman at mrcc.com #include #include +#include #include #include #include @@ -1344,7 +1345,7 @@ const std::list >& attributes) } OGRLayer* layer; - layer = dataSource->CreateLayer(uri, reference, (OGRwkbGeometryType)vectortype, NULL); + layer = dataSource->CreateLayer(NULL, reference, (OGRwkbGeometryType)vectortype, NULL); if(layer == NULL) { return false; @@ -1386,10 +1387,14 @@ const std::list >& attributes) } OGRDataSource::DestroyDataSource(dataSource); + + qWarning("GDAL Version number is: "+QString::number(GDAL_VERSION_NUM)); +#if GDAL_VERSION_NUM >= 1310 if(reference) { reference->Release(); } +#endif //GDAL_VERSION_NUM return true; } diff --git a/src/qgisapp.cpp b/src/qgisapp.cpp index 938278d690f..22fa4b48e86 100644 --- a/src/qgisapp.cpp +++ b/src/qgisapp.cpp @@ -2025,7 +2025,6 @@ void QgisApp::newVectorLayer() filename += ".shp"; } -#if 0 //try to create the new layer with OGRProvider instead of QgsVectorFileWriter QgsProviderRegistry * pReg = QgsProviderRegistry::instance(); QString ogrlib = pReg->library("ogr"); @@ -2070,9 +2069,9 @@ const std::list >&); qWarning("Resolving newEmptyDataSource(...) failed");; #endif } - } -#endif //0 + } +#if 0 //create the new layer with QgsVectorFileWriter QgsVectorFileWriter* writer=0; @@ -2131,6 +2130,7 @@ const std::list >&); } } delete writer; +#endif //0 //then add the layer to the view QStringList filelist;