Bug 438519

Summary: 'OK' button in the 'Paste clipboard contents' dialog is always enabled, even if the filename field is empty. And a confusing "File already exists" dialog appears if I click on it.
Product: [Frameworks and Libraries] frameworks-kio Reporter: Patrick Silva <bugseforuns>
Component: generalAssignee: KIO Bugs <kio-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: a.samirh78, bizyaev, kdelibs-bugs, kfm-devel, nate
Priority: NOR    
Version: 5.105.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Patrick Silva 2021-06-12 18:53:40 UTC
STEPS TO REPRODUCE
1. copy text
2. open Dolphin
3. press ctrl+v

OBSERVED RESULT
A window to create a file with pasted contents shows up.
"OK" button is active despite file name field is empty,
"File already exists" dialog appears when I click on it.

EXPECTED RESULT
keep "OK" greyed out until th user starts to type a file name.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux
(available in About System)
KDE Plasma Version: Plasma 5.22
KDE Frameworks Version: 5.82
Qt Version: Qt 5.15.2
Comment 1 Nate Graham 2021-06-15 23:17:07 UTC
Can confirm.
Comment 2 Nate Graham 2021-06-15 23:53:49 UTC
The  bug is clearly that the OK button in the QDialogButtonBox isn't disabled by default and its enablement connected to the length of the text field being > 0, and it's also clearly somewhere in paste.cpp, pastedialog.cpp, or pastejob.cpp, but none of my changes seem to be taking effect and I'm giving up for now.
Comment 3 Ahmad Samir 2021-06-18 21:15:49 UTC
It looks like this is using QInputDialog::getText() in the getNewFileName() method in paste.cpp, probably should be switched to use PasteDialog.
Comment 4 Patrick Silva 2021-08-04 22:05:52 UTC
*** Bug 440488 has been marked as a duplicate of this bug. ***
Comment 5 Patrick Silva 2021-08-23 22:23:35 UTC
The same happens with "OK" button of the dialog to create a tag (context menu > Assign tags > Create).
Comment 6 Patrick Silva 2024-02-29 14:17:22 UTC
It's still reproducible on Plasma 6.

Operating System: Arch Linux 
KDE Plasma Version: 6.0.0
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Graphics Platform: Wayland