Skip to content
  • Friedemann Kleint's avatar
    Fix no warning for overwriting files in non-native dialogs · c5c9528b
    Friedemann Kleint authored and Agata Cacko's avatar Agata Cacko committed
    Before this commit, in case a user wanted to Save As "filename",
    Krita would add an extension based on the selected filter.
    In native file dialogs, Krita will warn user if it would
    overwrite the file. In non-native file dialogs though
    (based on Qt widgets), it wouldn't happen.
    
    This commit makes it possible to append the extension before
    the non-native file dialog is closed, which enables warning
    before overwriting the file inside the file dialog.
    
    This commit applies the patch from Qt bug report:
    https://bugreports.qt.io/browse/QTBUG-27186
    https://codereview.qt-project.org/c/qt/qtbase/+/109815/
    
    Author of the patch and info from the original commit:
    Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
    Task-number: QTBUG-27186
    Change-Id: I3ece055b328dfe361b93e68954cb0a33bd9e7d94
    "The Windows native dialog prefers the name filter over the
    defaultSuffix (uses the same mechanism), I chose the convervative
    approach here (defaultSuffix takes precedence)."
    
    CCBUG:412651
    c5c9528b