Bug 497272

Summary: Misbehavior in file saving
Product: [Applications] Karp Reporter: Soumyadeep Ghosh <soumyadeepghosh2004>
Component: generalAssignee: SeeLook <seelook>
Status: CLOSED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Soumyadeep Ghosh 2024-12-10 12:34:32 UTC
SUMMARY
QPdf needs `--replace-input` to overwrite a file, which is not given when the user wants to overwrite the pdf file. Also, the case where no output file is given isn't handled at all. Thus making the app to misbehave.

STEPS TO REPRODUCE
1. Open pdfs and change it
2. Click on Save As button 
3. Press Cancel on the file picker

OBSERVED RESULT
See a failure logged in the terminal and a loading screen in the GUI

EXPECTED RESULT
The app should've gracefully handled these cases.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 SeeLook 2024-12-10 19:27:43 UTC
Git commit c3505240ec2365b912ea4a3d4ca34d93a7fcb2c9 by Tomasz Bojczuk.
Committed on 10/12/2024 at 19:27.
Pushed by tomaszbojczuk into branch 'master'.

Pdf model: cancel process when out file name is not provided

M  +6    -0    src/pdfeditmodel.cpp

https://invent.kde.org/graphics/karp/-/commit/c3505240ec2365b912ea4a3d4ca34d93a7fcb2c9
Comment 2 SeeLook 2024-12-10 19:35:31 UTC
Not that easy.
replace-input() option and method works fine for first input file,
but when there are more files and user tries to override one of file in the middle
terrible things happen - as terrible as blank pages.