File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -203,18 +203,24 @@ def check_editable_vectors_format(self):
203203 self .issues .append (SingleLayerWarning (lid , Warning .EDITABLE_NON_GPKG ))
204204
205205 def check_saved_in_proj_dir (self ):
206- """Check if layers saved in project's directory."""
206+ """Check if layers are stored inside the project's directory."""
207207 for lid , layer in self .layers .items ():
208208 if lid not in self .layers_by_prov ["gdal" ] + self .layers_by_prov ["ogr" ]:
209209 continue
210+
210211 pub_src = layer .publicSource ()
212+
211213 if pub_src .startswith ("GPKG:" ):
212214 pub_src = pub_src [5 :]
213215 l_path = pub_src [: pub_src .rfind (":" )]
214216 else :
215217 l_path = layer .publicSource ().split ("|" )[0 ]
216- l_dir = os .path .dirname (l_path )
217- if not same_dir (l_dir , self .qgis_proj_dir ):
218+
219+ # normalize path
220+ l_path = os .path .abspath (l_path )
221+
222+ # check if layer file is inside project directory
223+ if not is_inside (self .qgis_proj_dir , l_path ):
218224 self .issues .append (SingleLayerWarning (lid , Warning .EXTERNAL_SRC ))
219225
220226 def check_offline (self ):
You can’t perform that action at this time.
0 commit comments