File tree 1 file changed +12
-9
lines changed
1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -1075,20 +1075,23 @@ int QgsOgrProvider::capabilities() const
1075
1075
#endif
1076
1076
1077
1077
// OGR doesn't handle shapefiles without attributes, ie. missing DBFs well, fixes #803
1078
- if ( ogrDriverName.startsWith ( " ESRI" ) && mAttributeFields . size () == 0 )
1078
+ if ( ogrDriverName.startsWith ( " ESRI" ) )
1079
1079
{
1080
- QgsDebugMsg ( " OGR doesn't handle shapefile without attributes well, ie. missing DBFs" );
1081
- ability &= ~( AddFeatures | DeleteFeatures | ChangeAttributeValues | AddAttributes | DeleteAttributes );
1080
+ if ( mAttributeFields .size () == 0 )
1081
+ {
1082
+ QgsDebugMsg ( " OGR doesn't handle shapefile without attributes well, ie. missing DBFs" );
1083
+ ability &= ~( AddFeatures | DeleteFeatures | ChangeAttributeValues | AddAttributes | DeleteAttributes );
1084
+ }
1085
+
1086
+ if (( ability & ChangeAttributeValues ) == 0 )
1087
+ {
1088
+ // on readonly shapes OGR reports that it can delete features although it can't RandomWrite
1089
+ ability &= ~( AddAttributes | DeleteFeatures );
1090
+ }
1082
1091
}
1083
1092
}
1084
1093
1085
1094
return ability;
1086
-
1087
- /*
1088
- return (QgsVectorDataProvider::AddFeatures
1089
- | QgsVectorDataProvider::ChangeAttributeValues
1090
- | QgsVectorDataProvider::CreateSpatialIndex);
1091
- */
1092
1095
}
1093
1096
1094
1097
You can’t perform that action at this time.
0 commit comments