Bug 496480

Summary: LabPlot deletes Origin files
Product: [Applications] LabPlot2 Reporter: uwestoehr <uwestoehr>
Component: generalAssignee: Stefan Gerlach <stefan.gerlach>
Status: RESOLVED FIXED    
Severity: major CC: stefan.gerlach
Priority: NOR    
Version First Reported In: latest   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: original Origin file
screenshot of the dialog that pops up on closing LabPlot
the result - an empty Origin file
screencast showing the recipe to reproduce
screenshot showinghe OPJ file when it is loaded
screenshot showing that the OPJ file was modified

Description uwestoehr 2024-11-20 02:59:16 UTC
Created attachment 175966 [details]
original Origin file

This is with the nightly build 19-11-2024:

- open the attached Origin file
- in the plot move the legend just a millimeter (that it disappears is bug 496478)
- now just close LabPlot

result: you are asked to save the project UNTITLED, see the screenshot attached
Click Yes
result: you don't get a new LabPlot file, but the Origin file is overwritten. Attached is the result -> the file is empty

This is a major bug because you loose your data if you haven't made a backup of your Origin file.
Comment 1 uwestoehr 2024-11-20 03:00:46 UTC
Created attachment 175967 [details]
screenshot of the dialog that pops up on closing LabPlot
Comment 2 uwestoehr 2024-11-20 03:01:28 UTC
Created attachment 175968 [details]
the result - an empty Origin file
Comment 3 Stefan Gerlach 2024-11-20 23:16:17 UTC
When i press "Save" when ask while closing LabPlot, i get a new file dialog to select the LML file to save to. The original OPJ file can not be selected for overwriting. Did i miss something?
I'm curious how you could select an OPJ file for saving.
Comment 4 uwestoehr 2024-11-24 00:44:34 UTC
(In reply to Stefan Gerlach from comment #3)
> I'm curious how you could select an OPJ file for saving.

I did not select it. here again my recipe:
1. double-click on the OPJ file (see the attached screenshot showing that the OPJ file was last modified on Nov 20)
2. go to the plot
3. move the legend a bit
4. click on LabPlot's main window to close it
5. in the appearing save dialog click "Save"
(see the attached screencast that shows step 2. to 5.

as result you get an empty OPJ file, see the attached screenshot that shows that the file was now modified.
Comment 5 uwestoehr 2024-11-24 00:44:57 UTC
Created attachment 176073 [details]
screencast showing the recipe to reproduce
Comment 6 uwestoehr 2024-11-24 00:45:58 UTC
Created attachment 176074 [details]
screenshot showinghe OPJ file when it is loaded
Comment 7 uwestoehr 2024-11-24 00:47:00 UTC
Created attachment 176075 [details]
screenshot showing that the OPJ file was modified
Comment 8 Stefan Gerlach 2024-11-26 16:44:32 UTC
Git commit bb7c42d7bb3b47d131a5ac5cfe83ed422577da6c by Stefan Gerlach.
Committed on 26/11/2024 at 16:26.
Pushed by sgerlach into branch 'master'.

don't overwrite OPJ files when saving

M  +6    -3    src/frontend/MainWin.cpp

https://invent.kde.org/education/labplot/-/commit/bb7c42d7bb3b47d131a5ac5cfe83ed422577da6c