| Summary: | Create new folder with existent name does nothing | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] frameworks-kio | Reporter: | Gregor Mi <codestruct> |
| Component: | general | Assignee: | David Faure <faure> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | normal | CC: | aryan100jangid, emmanuelpescosta099, kdelibs-bugs-null, nate |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Gregor Mi
2015-11-19 16:03:17 UTC
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). *** This bug has been marked as a duplicate of bug 400423 *** |