Port the Open code away from NetAccess.
ClosedPublic

Authored by dfaure on Nov 22 2019, 10:48 PM.

Details

Summary

NetAccess::download used a temp file, to then load that with
QImageReader.

I'm using an in-memory buffer instead, mostly because it's
less code. It should also be faster, at the expense of more
memory usage of course (the PNG data should be less than the
image data anyway).

Test Plan

Opening files still works

Diff Detail

Repository
R374 KolourPaint
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
dfaure requested review of this revision.Nov 22 2019, 10:48 PM
dfaure created this revision.
broulik added inline comments.Nov 23 2019, 2:42 PM
document/kpDocument_Open.cpp
235

I have a

!KIO::NetAccess::exists (url, KIO::NetAccess::SourceSide/*open*/, d->environ->dialogParent ()))

here which I don't know why you don't have.

dfaure added inline comments.Nov 23 2019, 2:48 PM
document/kpDocument_Open.cpp
235

That's because this commit sits on top of others. I moved that call into the new urlExists method. See D25468

vkrause accepted this revision.Nov 27 2019, 5:54 PM
This revision is now accepted and ready to land.Nov 27 2019, 5:54 PM
This revision was automatically updated to reflect the committed changes.