Krita - Make some file formats return KisImportExportFilter::UserCancelled when their options dialogs are cancelled
ClosedPublic

Authored by nicholasl on Nov 16 2015, 2:15 AM.

Details

Reviewers
rempt
Group Reviewers
Krita: Stable
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.

Diff Detail

Repository
R8 Calligra
Lint
Lint Skipped
Unit
Unit Tests Skipped
nicholasl updated this revision to Diff 1297.Nov 16 2015, 2:15 AM
nicholasl retitled this revision from to Krita - Make some file formats return KisImportExportFilter::UserCancelled when their options dialogs are cancelled.
nicholasl updated this object.
nicholasl edited the test plan for this revision. (Show Details)
nicholasl added a reviewer: Krita: Stable.
nicholasl set the repository for this revision to R8 Calligra.
rempt accepted this revision.Nov 16 2015, 7:07 AM
rempt added a reviewer: rempt.
rempt added a subscriber: rempt.

Cool, thanks for the work! Can you push the patch yourself?

This revision is now accepted and ready to land.Nov 16 2015, 7:07 AM

I'm unable to push since I don't have developer access.

rempt added a comment.Nov 17 2015, 7:43 AM

Okay, I'll push it! And thanks again!

nicholasl closed this revision.Jan 21 2016, 3:34 PM