Fix loading wrong file format (progress bar + recent docs)

Authored by tymond on Mar 8 2019, 2:09 PM.



Before this patch, when you forced Krita to load file in
unknown format, it showed uncancelled progress bar and
showed the file in Recent Documents.
It happened when you dragged and dropped file to the
welcome screen or import animation frames or use Open->File
or Open -> Recent Files.
Progress bars were visible only when some image was opened.
This commit cancels progress bars and make sure unloadable
files are not added to Recent Documents.


Test Plan
  1. Create an unloadable file. Can be "touch a".
  2. Load it using one of the ways mentioned above
  3. After loading, there is an error message. Click ok.
  4. If you used Import Animation Frames, look at the bottom

of Krita window.

  • before: progress bar still "loading"
  • now: no progress bar visible
  • If you used other option, create a new file or open

something else, and you'll see the same effect.

  1. Look at Recent Documents.
  2. before: unloadable file added to list
  3. now: no unloadable file added to list

(beside the ones that were aleady there after testing)

Diff Detail

R37 Krita
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
tymond created this revision.Mar 8 2019, 2:09 PM
Restricted Application added a reviewer: Krita. · View Herald TranscriptMar 8 2019, 2:09 PM
Restricted Application added a project: Krita. · View Herald Transcript
tymond requested review of this revision.Mar 8 2019, 2:09 PM
tymond edited the summary of this revision. (Show Details)Mar 8 2019, 2:15 PM
tymond added a comment.Mar 8 2019, 3:06 PM

I fixed both Recent Documents and progress bars, but repeated error messages are probably still to be fixed. I couldn't reproduce it with a simple touched file on Linux. I'll try to find some mp4 files to check if the behaviour is different then (it shouldn't).

And if I try to add File layer with a file in a wrong format exactly the same way OP in the bug report said, I don't get error messages at all. (I get them if I add File layer from the dropdown in Layers docker).

The behaviour on Windows is still to be determined, I haven't check it there yet.

rempt accepted this revision.Mar 11 2019, 2:13 PM
This revision is now accepted and ready to land.Mar 11 2019, 2:13 PM
This revision was automatically updated to reflect the committed changes.