Commit 29378564 authored by Benjamin Löwe's avatar Benjamin Löwe
Browse files

corrections to my last commit, easier to read now

parent a105634d
......@@ -238,16 +238,18 @@ void RasterImageView::setAlphaBackgroundColor(const QColor& color)
void RasterImageView::loadFromDocument()
{
Document::Ptr doc = document();
if (doc) {
connect(doc.data(), SIGNAL(metaInfoLoaded(KUrl)),
SLOT(slotDocumentMetaInfoLoaded()));
connect(doc.data(), SIGNAL(isAnimatedUpdated()),
SLOT(slotDocumentIsAnimatedUpdated()));
const Document::LoadingState state = doc->loadingState();
if (state == Document::MetaInfoLoaded || state == Document::Loaded) {
slotDocumentMetaInfoLoaded();
}
if (!doc) {
return;
}
connect(doc.data(), SIGNAL(metaInfoLoaded(KUrl)),
SLOT(slotDocumentMetaInfoLoaded()));
connect(doc.data(), SIGNAL(isAnimatedUpdated()),
SLOT(slotDocumentIsAnimatedUpdated()));
const Document::LoadingState state = doc->loadingState();
if (state == Document::MetaInfoLoaded || state == Document::Loaded) {
slotDocumentMetaInfoLoaded();
}
}
......
......@@ -50,21 +50,23 @@ SvgImageView::SvgImageView(QGraphicsItem* parent)
void SvgImageView::loadFromDocument()
{
Document::Ptr doc = document();
if (doc) {
QSvgRenderer* renderer = doc->svgRenderer();
if (!renderer) {
kWarning() << "No SVG renderer. This should not happen!";
return;
}
mSvgItem->setSharedRenderer(renderer);
if (zoomToFit()) {
setZoom(computeZoomToFit(), QPointF(-1, -1), ForceUpdate);
} else {
mSvgItem->setScale(zoom());
}
applyPendingScrollPos();
completed();
if (!doc) {
return;
}
QSvgRenderer* renderer = doc->svgRenderer();
if (!renderer) {
kWarning() << "No SVG renderer. This should not happen!";
return;
}
mSvgItem->setSharedRenderer(renderer);
if (zoomToFit()) {
setZoom(computeZoomToFit(), QPointF(-1, -1), ForceUpdate);
} else {
mSvgItem->setScale(zoom());
}
applyPendingScrollPos();
completed();
}
void SvgImageView::onZoomChanged()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment