1) Create New... Folder 2) Enter a name of a folder which already exists 3) OK ACTUAL: nothing happens EXPECTED: some notification that the folder already exists.
Thanks for the bug report! Looks like the problem is in MkpathJob::slotResult which is in KIO, but I have no time to test it atm. if (job->error() && job->error() != KIO::ERR_DIR_ALREADY_EXIST) { KIO::Job::slotResult(job); // will set the error and emit result(this) return; } The "job->error() != KIO::ERR_DIR_ALREADY_EXIST" check looks strange?!
That's the intended behavior for MkpathJob, which is the network-transparent version of QDir::mkpath() or `mkdir -p`. It's used by programs to ensure that a given directory exists. If it already exists, everything's ok. Maybe dolphin should use KIO::mkdir rather than KIO::mkpath?
(In reply to David Faure from comment #2) > That's the intended behavior for MkpathJob, which is the network-transparent > version of QDir::mkpath() or `mkdir -p`. It's used by programs to ensure > that a given directory exists. If it already exists, everything's ok. Thanks for the info, didn't know that :) > Maybe dolphin should use KIO::mkdir rather than KIO::mkpath? Ok then we have to change it in KNewFileMenuPrivate::_k_slotCreateDirectory (uses KIO::mkpath atm)
On second thought I assume the use of mkpath was to make it possible to create folder/subfolder/ in one go. In that case, the code would have to use KIO::stat first, to error if it already exists, and then mkpath (from the slot connected to KIO::stat).
https://phabricator.kde.org/D17617
*** This bug has been marked as a duplicate of bug 400423 ***