Skip to content
Permalink
Browse files
eliminate the OGR message about not being able to open a read-only
.shp file (if it is read-only, qgis then tries to open it read-only,
so the OGR error message is unnecessary).


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5617 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Jul 21, 2006
1 parent 7f9b89a commit d5a4a56a5a89c780d7da6abcde7eba7f8d12f73d
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/providers/ogr/qgsogrprovider.cpp
@@ -88,8 +88,13 @@ QgsOgrProvider::QgsOgrProvider(QString const & uri)

QgsDebugMsg("Data source uri is " + uri);

// try to open for update
// try to open for update, but disable error messages to avoid a
// message if the file is read only, because we cope with that
// ourselves.
CPLPushErrorHandler(&CPLQuietErrorHandler);
ogrDataSource = OGRSFDriverRegistrar::Open(QFile::encodeName(uri).constData(), TRUE, &ogrDriver);
CPLPopErrorHandler();

if(ogrDataSource == NULL)
{
// try to open read-only

0 comments on commit d5a4a56

Please sign in to comment.