Fix reloading of SVG images

Authored by muhlenpfordt on Apr 15 2018, 6:02 AM.

Description

Fix reloading of SVG images

Summary:
If an SVG image is reloaded (F5 or FileReload) 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:

  1. Open SVG image in View Mode
  2. Press F5 to reload
  3. Zoom by mouse scroll or moving the slider
  4. Gwenview should not crash
  1. Open SVG image in View Mode
  2. Overwrite viewed file with another SVG outside Gwenview
  3. Press F5 to reload
  4. New image should display

Reviewers: Gwenview, rkflx

Reviewed By: Gwenview, rkflx

Subscribers: rkflx, huoni

Differential Revision: https://phabricator.kde.org/D12187

Details

Committed
muhlenpfordtApr 15 2018, 7:50 AM
Reviewer
Gwenview
Differential Revision
D12187: Fix reloading of SVG images
Parents
R260:aeeb5d461fe4: Adapt PlaceTreeModelTest autotest to KIO change
Branches
Unknown
Tags
Unknown