Bug 92034

Summary: KFileDialog::getSaveURL() doesn't say if a file already exists
Product: [Frameworks and Libraries] kio Reporter: Sebastien <slaout>
Component: kfileAssignee: Carsten Pfeiffer <pfeiffer>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description Sebastien 2004-10-24 22:13:52 UTC
Version:            (using KDE KDE 3.3.0)
Installed from:    Compiled From Sources

When using KFileDialog to get a save url or file, if I select an existing file the save dialog don't show a confirmation message to ask me if I want to overwrite the existing file or not.

Perhapse I haven't searched enoutgh (because it's strange KDE doesn't provide such parameter), but I haven't found any parameter to ask confirmation.

So, it's what I do:

    KURL url;
    bool tryAgain = true;
    while (tryAgain)
    {
        url = KFileDialog::getSaveURL();

        if (url.isEmpty())
        {
            tryAgain = false;
        }

        if (!KIO::NetAccess::exists(url, true, this) ||
            KMessageBox::warningYesNo(this, "<qt>" + i18n("The file <strong>%1</strong> already exists. Do you wish to overwrite it?").arg(url.prettyURL()) + "</qt>", i18n("File Exists")) == KMessageBox::Yes)
        {
            tryAgain = false;
        }
    }

Very heavy to do this, and the message can to not be the same as in other applications.
Comment 1 Christian Loose 2005-06-11 12:13:06 UTC

*** This bug has been marked as a duplicate of 102972 ***