Skip to content

Commit

Permalink
eliminate the OGR message about not being able to open a read-only
Browse files Browse the repository at this point in the history
.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@5617 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Jul 21, 2006
1 parent 443e85b commit 6cf9f11
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/providers/ogr/qgsogrprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6cf9f11

Please sign in to comment.