Skip to content

Commit

Permalink
Do not ask to overide a previous CFG if it was already existing
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry committed Sep 17, 2024
1 parent a4b8e67 commit 0787c28
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion lizmap/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand All @@ -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
Expand Down

0 comments on commit 0787c28

Please sign in to comment.