Bug 497272 - Misbehavior in file saving
Summary: Misbehavior in file saving
Status: CLOSED FIXED
Alias: None
Product: Karp
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: SeeLook
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-10 12:34 UTC by Soumyadeep Ghosh
Modified: 2024-12-10 19:56 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.