clean up the svg if we change the image strategy

svn path=/trunk/KDE/kdelibs/; revision=1022990
This commit is contained in:
Aaron J. Seigo 2009-09-13 17:15:56 +00:00
parent 45b39e84c4
commit 9525a9a267
5 changed files with 20 additions and 0 deletions

View File

@ -48,6 +48,8 @@ public:
void setPixmap() void setPixmap()
{ {
if (imagePath.isEmpty()) { if (imagePath.isEmpty()) {
delete svg;
svg = 0;
return; return;
} }
@ -65,6 +67,8 @@ public:
QPainter p(&pm); QPainter p(&pm);
svg->paint(&p, pm.rect()); svg->paint(&p, pm.rect());
} else { } else {
delete svg;
svg = 0;
pm = QPixmap(absImagePath); pm = QPixmap(absImagePath);
} }

View File

@ -52,6 +52,8 @@ public:
void setPixmap() void setPixmap()
{ {
if (imagePath.isEmpty()) { if (imagePath.isEmpty()) {
delete svg;
svg = 0;
return; return;
} }
@ -69,6 +71,8 @@ public:
QPainter p(&pm); QPainter p(&pm);
svg->paint(&p, pm.rect()); svg->paint(&p, pm.rect());
} else { } else {
delete svg;
svg = 0;
pm = QPixmap(absImagePath); pm = QPixmap(absImagePath);
} }

View File

@ -62,6 +62,8 @@ public:
void setPixmap() void setPixmap()
{ {
if (imagePath.isEmpty()) { if (imagePath.isEmpty()) {
delete svg;
svg = 0;
return; return;
} }
@ -92,6 +94,8 @@ public:
svg->paint(&p, pm.rect()); svg->paint(&p, pm.rect());
} }
} else { } else {
delete svg;
svg = 0;
pm = QPixmap(absImagePath); pm = QPixmap(absImagePath);
} }

View File

@ -48,6 +48,8 @@ public:
void setPixmap() void setPixmap()
{ {
if (imagePath.isEmpty()) { if (imagePath.isEmpty()) {
delete svg;
svg = 0;
return; return;
} }
@ -65,6 +67,8 @@ public:
QPainter p(&pm); QPainter p(&pm);
svg->paint(&p, pm.rect()); svg->paint(&p, pm.rect());
} else { } else {
delete svg;
svg = 0;
pm = QPixmap(absImagePath); pm = QPixmap(absImagePath);
} }

View File

@ -62,6 +62,8 @@ public:
void setPixmap() void setPixmap()
{ {
if (imagePath.isEmpty()) { if (imagePath.isEmpty()) {
delete svg;
svg = 0;
return; return;
} }
@ -92,6 +94,8 @@ public:
svg->paint(&p, pm.rect()); svg->paint(&p, pm.rect());
} }
} else { } else {
delete svg;
svg = 0;
pm = QPixmap(absImagePath); pm = QPixmap(absImagePath);
} }