Skip to content
  • Halla Rempt's avatar
    Make some file formats return KisImportExportFilter::UserCancelled when their... · c9f20bed
    Halla Rempt authored
    Make some file formats return KisImportExportFilter::UserCancelled when their options dialogs are cancelled
    
    Summary:
    The file formats affected by this patch are: r16 heightmap/r8 heightmap/JPEG-2000/JPEG/PNG/PPM/PGM/PBM
    
    These formats return KisImportExportFilter::OK rather than KisImportExportFilter::UserCancelled when their import/export options dialog is cancelled.
    
    This leads to buggy behaviour that can be reproduced using either set of the following steps:
    CASE 1
        * Create a new document and modify it
        * Close the document and opt to save it as one of the affected formats
        * Cancel when the export options appear
        * (The document closes without saving)
    CASE 2
        * Open a heightmap
        * Cancel when the import options appear
        * (Krita crashes)
    
    I've also modified kis_png_export.cc so that it sets up the Cancel/OK buttons explicitly instead of relying on getting them by default from KDialog.
    
    Reviewers: #krita:_stable, rempt
    
    Reviewed By: #krita:_stable, rempt
    
    Subscribers: rempt
    
    Differential Revision: https://phabricator.kde.org/D548
    
    Patch by Nicholas LaPointe, thanks!
    c9f20bed