Fix reloading of SVG images
Summary:
If an SVG image is reloaded (F5 or File → Reload) the
QSvgRenderer is not updated after loading and Gwenview crashes
when trying to zoom. If the SVG file is changed outside Gwenview
while it is viewed and then reloaded it's not updated.
This is caused by a missing connection to the loaded() signal
and calling SvgImageView::finishLoadFromDocument() to setup the
new renderer.
BUG: 359736
FIXED-IN: 18.04.1
Test Plan:
- Open SVG image in View Mode
- Press F5 to reload
- Zoom by mouse scroll or moving the slider
- Gwenview should not crash
- Open SVG image in View Mode
- Overwrite viewed file with another SVG outside Gwenview
- Press F5 to reload
- New image should display
Reviewers: Gwenview, rkflx
Reviewed By: Gwenview, rkflx
Subscribers: rkflx, huoni
Differential Revision: https://phabricator.kde.org/D12187