diff --git a/CHANGELOG.md b/CHANGELOG.md index cb567b4f..7a6b879c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +* Do not ask to override a previous CFG when saving a QGS file to a new destination * Raise QGIS minimum version to 3.22 ## 4.3.24 - 2024-09-09 diff --git a/lizmap/plugin.py b/lizmap/plugin.py index 8f1ac977..66820f28 100755 --- a/lizmap/plugin.py +++ b/lizmap/plugin.py @@ -982,6 +982,11 @@ def filename_changed(self): # Until https://github.com/enricofer/autoSaver/pull/22 is merged return + new_cfg = new_path.with_suffix('.qgs.cfg') + if new_cfg.exists(): + # The CFG was already here, let's keep the previous one + return + if self.current_path and new_path != self.current_path and not to_bool(os.getenv("CI"), default_value=False): old_cfg = self.current_path.with_suffix('.qgs.cfg') if old_cfg.exists(): @@ -999,7 +1004,7 @@ def filename_changed(self): if result == QMessageBox.No: return - copyfile(str(old_cfg), str(new_path.with_suffix('.qgs.cfg'))) + copyfile(str(old_cfg), str(new_cfg)) LOGGER.info("Project has been renamed and Lizmap configuration file has been copied as well.") self.current_path = new_path