Bug 221624

Summary: KIO::move() ignores KIO::Overwrite and displays a question about overwriting nevertheless
Product: [Unmaintained] kio Reporter: urwald <urwald>
Component: generalAssignee: David Faure <faure>
Status: RESOLVED WORKSFORME    
Severity: wishlist CC: nate, staniek
Priority: NOR Keywords: triaged
Version First Reported In: 4.3   
Target Milestone: ---   
Platform: openSUSE   
OS: Unspecified   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description urwald 2010-01-07 10:34:48 UTC
Version:            (using KDE 4.3.4)
Installed from:    openSUSE RPMs

When the following code

  KIO::CopyJob *copyjob = KIO::move(tempfile.fileName(),
                                    helper_stationlistXmlFilepath(),
                                    KIO::HideProgressInfo | KIO::Overwrite);

is executed, a question is displayed if the user really wants to overwrite the file. It seems that the flag "KIO::Overwrite" is ignored.

Workaround for single files:

  KIO::FileCopyJob *copyjob = KIO::file_move(tempfile.fileName(),
                                    helper_stationlistXmlFilepath(),
                                    -1,
                                    KIO::HideProgressInfo | KIO::Overwrite);

works fine and doesn't display an overwrite warning.
Comment 1 David Faure 2010-01-07 19:29:30 UTC
This is not actually a bug. The documentation for KIO::move says:
     * @param flags: We support HideProgressInfo here

Which means, Overwrite is not supported there.

setUiDelegate(0) would make it abort instead of asking the question, but that's not exactly what you want either.

I can see the point in adding support for KIO::Overwrite in KIO::move and KIO::copy, so this is a valid request for 4.5, but it's not a bug, sorry ;)

But maybe it would be better to add a setOverwriteAllFiles() instead, given that it complements the existing setWriteIntoExistingDirectories(true)...

Anyway, for single files, you definitely want to use file_move instead.
Comment 2 Jarosław Staniek 2012-02-22 21:51:43 UTC
Hi, anything new in this area? I can see this note in API docs: "supports HideProgressInfo and Overwrite" for KIO::move(), KIO::copy() anf other functions.

http://api.kde.org/4.x-api/kdelibs-apidocs/kio/html/namespaceKIO.html#a105292786e2c340dc48192c48d605944

So Overwrite is allowed there and if wouldn't work, then there's a bug in docs or in the code.
Comment 3 Nate Graham 2018-04-25 18:55:31 UTC
Is this still an issue in KDE Frameworks 5.45?
Comment 4 Andrew Crouthamel 2018-09-28 03:38:57 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 5 Andrew Crouthamel 2018-10-29 02:16:39 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!