Bug 420528 - Gwenview SaveAs overwrites file without asking for confirmation
Summary: Gwenview SaveAs overwrites file without asking for confirmation
Status: RESOLVED FIXED
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: 20.04.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: msmetko
URL:
Keywords: junior-jobs
: 423869 425546 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-04-24 21:44 UTC by Patrick Silva
Modified: 2020-08-20 09:54 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 20.08.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2020-04-24 21:44:13 UTC
SUMMARY


STEPS TO REPRODUCE
1. crop an image with Gwenview (a bar appears on top)
2. click on "Save as" button of such bar
3. double click on any image except the one you cropped

OBSERVED RESULT
Gwenview overwrites the double clicked image without asking for confirmation

EXPECTED RESULT
Gwenview should ask for confirmation before overwriting a file

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.18.4
KDE Frameworks Version: 5.69.0
Qt Version: 5.14.2
Comment 1 Christoph Feck 2020-05-14 12:52:49 UTC
Interesting. In save mode, the file dialog should have taken care of asking.
Comment 2 Christoph Feck 2020-05-14 13:03:50 UTC
It's caused by using KFileCustomDialog, which lacks the code to handle the safety net.
Comment 3 Christoph Feck 2020-05-14 14:04:41 UTC
Sorry, I was wrong.

Gwenview just misses the "setConfirmOverwrite(true);" line.

https://cgit.kde.org/gwenview.git/tree/app/gvcore.cpp#n107
Comment 4 JanKusanagi 2020-05-14 16:12:14 UTC
Can confirm I just noticed this, too.

My process wasn't by means of clicking any files, just selecting a different image format, which kept the file name and changed the extension. If another file with this name and the "new" extension already existed, it was overwritten without question.
Comment 5 msmetko 2020-05-22 01:08:02 UTC
(In reply to Christoph Feck from comment #3)
> Sorry, I was wrong.
> 
> Gwenview just misses the "setConfirmOverwrite(true);" line.
> 
> https://cgit.kde.org/gwenview.git/tree/app/gvcore.cpp#n107

Is this fixed? If not, I'd like to volunteer
Comment 6 Christoph Feck 2020-05-22 08:20:46 UTC
Sure, get involved :)

https://community.kde.org/Get_Involved

Please assign the bug to yourself so that others can see you are preparing a patch by clicking (take) and setting the status to ASSIGNED.
Comment 7 Nate Graham 2020-05-26 17:18:02 UTC
Git commit b41631b229b6513137535a71436750d42c674bc5 by Nate Graham, on behalf of Marijan Smetko.
Committed on 26/05/2020 at 17:18.
Pushed by ngraham into branch 'master'.

Add file overwrite prompt when saving a file
FIXED-IN: 20.08.0

M  +1    -0    app/gvcore.cpp

https://invent.kde.org/graphics/gwenview/commit/b41631b229b6513137535a71436750d42c674bc5
Comment 8 Patrick Silva 2020-07-04 21:12:53 UTC
*** Bug 423869 has been marked as a duplicate of this bug. ***
Comment 9 Christoph Feck 2020-08-20 09:54:57 UTC
*** Bug 425546 has been marked as a duplicate of this bug. ***