Bug 403146

Summary: Extracting suggests replacement file with info of destination file
Product: [Applications] ark Reporter: Papoteur <yves.brungard_mageia>
Component: generalAssignee: Elvis Angelaccio <elvis.angelaccio>
Status: CONFIRMED ---    
Severity: normal CC: 8osnhxifsxph2y, andrew.crouthamel, bugseforuns, filippovolpe98, kapfell, kde, postix, rthomsen6, yves.brungard_mageia
Priority: HI Keywords: investigated, triaged
Version: 21.04.2   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Dialog window
Patch for rename dialog
file conflict dialog from Ark 22.08.1

Description Papoteur 2019-01-12 17:21:45 UTC
Created attachment 117423 [details]
Dialog window

SUMMARY
Extracting a zip file to a destination which contains file with the same name. A dialog window asks for the replacement. It displays the two files with the same information which is the info of the destination file (name, size, date)

EXPECTED RESULT
The info should be the source size and date at least, and not the full path of the destination file.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Frameworks 5.42.0
Qt 5.9.4 (built against 5.9.3)
The xcb windowing system
Comment 1 Patrick Silva 2019-02-23 19:16:31 UTC
I can confirm. Source and destination files shown in the dialog are the same (destination file).

Ark 18.12.2
Operating System: Arch Linux 
KDE Plasma Version: 5.15.1
KDE Frameworks Version: 5.55.0
Qt Version: 5.12.1
Comment 2 Andrew Crouthamel 2019-03-12 01:37:07 UTC
Confirming based on Patrick's investigation.
Comment 3 Patrick Silva 2019-06-16 12:52:42 UTC
This bug persists with Ark 19.7.70 on neon dev unstable.
Comment 4 Patrick Silva 2019-08-17 02:33:39 UTC
*** Bug 410991 has been marked as a duplicate of this bug. ***
Comment 5 Patrick Silva 2020-01-21 16:15:18 UTC
*** Bug 414854 has been marked as a duplicate of this bug. ***
Comment 6 Patrick Silva 2020-01-27 18:49:28 UTC
*** Bug 416821 has been marked as a duplicate of this bug. ***
Comment 7 Papoteur 2020-02-01 14:52:11 UTC
Hi,
I investigated a little. What I found is that the dialog is provided by KIO as RenameDialog. It takes at least 2 parameters which hould be QUrl, one for source and a second for destination.
The dialog is called in queries.cpp [1] which THE SAME information for the two QUrl.
I don't know if this is an error or that the QUrl can't be built for the archive file.
In RenameDialog [2], file information are either read from system in case the QUrl.isLocalFile is true, or used from parameters given to the function.

[1] https://cgit.kde.org/ark.git/tree/kerfuffle/queries.cpp#n90
[2] https://cgit.kde.org/kio.git/tree/src/widgets/renamedialog.cpp#n217
Comment 8 Papoteur 2020-02-04 21:46:19 UTC
Created attachment 125677 [details]
Patch for rename dialog

Here I propose a patch that I have tested here with ark 19.04.0. It allows to have size an date of the source file from the archive, not the destination.
The modifications are :
- call overwriteQuery with the entry, not only the entry name.
- overloading the overwriteQuery to accept the entry.
- in case of call with query, call renameDialog with the name without formatting it with fromLocalFile, and adding date and size of the source, read from entry.

When QUrl is not a local file in renameDialog, displayed value are from the parameters passed with the call.
I didn't managed to create an account to access to phabricator, thus I leave the patch here.
Comment 9 Papoteur 2020-02-11 09:33:47 UTC
The patch is now on phabricator.
https://phabricator.kde.org/D27181
Comment 10 Méven Car 2020-11-03 17:37:30 UTC
*** Bug 428436 has been marked as a duplicate of this bug. ***
Comment 11 Méven Car 2021-03-03 10:10:21 UTC
*** Bug 433797 has been marked as a duplicate of this bug. ***
Comment 12 postix 2021-07-07 13:22:11 UTC
Is this really the same bug as I had reported here https://bugs.kde.org/show_bug.cgi?id=414854 ?

Because in my case it says '0 bytes' which is definitely not the destination's size and thus it sounds more like a different bug to me.

The fact that it shows the same info for both source and destination file, namely both 0 bytes size, may however be once again this bug here (403146).
Comment 13 Patrick Silva 2022-10-02 13:11:13 UTC
Still an issue with Ark 22.08.1 on Arch Linux.

Operating System: Arch Linux
KDE Plasma Version: 5.25.90
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6
Graphics Platform: Wayland
Comment 14 Patrick Silva 2022-10-02 13:14:37 UTC
Created attachment 152546 [details]
file conflict dialog from Ark 22.08.1

In fact, as we can observe in the screenshot attached to this comment, the file conflict dialog is different now. But it is still buggy.