https://bugs.kde.org/show_bug.cgi?id=157040

Harald Sitter <sit...@kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sit...@kde.org

--- Comment #3 from Harald Sitter <sit...@kde.org> ---
I don't think so. The slaves aren't what suggests the alternative names and
dolphin/kio supposedly already have listed the dir, so they would already know
if 'Foo' exists so the default can be 'Foo (1)' instead.

KIO simply chooses not do that for !local files

    if (defaultFile.isLocalFile() && QFile::exists(defaultFile.toLocalFile()))
{
        text = KFileUtils::suggestName(directory, text);
    }

Which at a glance is because KFileUtils::suggestName (from kcoreaddons) has no
way to check remote urls. I would think the suggestName function needs to take
a special indirection object as argument.

e.g. a function

KFileUtils::suggestName(directory, text, /* exists checker */ [](QUrl url) {
QFileInfo::exists(url) } );

obviously just an example, the actual function would check the protocol and
route through kio as necessary.
In any case the point is that the conflict check needs moving out of
kcoreaddons and into the caller (in our case KIO) so protocol support can kick
in.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to