mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
corregido bug en ImportWidget que causaba consumo excesivo de memoria
This commit is contained in:
parent
178305068d
commit
f173981a9d
@ -218,14 +218,22 @@ void ImportWidget::newComic(const QString & path, const QString & coverPath)
|
|||||||
if(previousWidth >= coversView->width()+200 && !updatingCovers)
|
if(previousWidth >= coversView->width()+200 && !updatingCovers)
|
||||||
{
|
{
|
||||||
updatingCovers = true;
|
updatingCovers = true;
|
||||||
QGraphicsItem * last = coversScene->items().last();
|
|
||||||
int width = p.width();
|
foreach(QGraphicsItem * itemToRemove, coversScene->items())
|
||||||
if(previousWidth > 3000)
|
|
||||||
{
|
{
|
||||||
coversScene->removeItem(last);
|
QGraphicsPixmapItem * last = dynamic_cast<QGraphicsPixmapItem *>(itemToRemove);
|
||||||
delete last;
|
|
||||||
|
if((last->pos().x()+last->pixmap().width())<=0)
|
||||||
|
{
|
||||||
|
coversScene->removeItem(last);
|
||||||
|
delete last;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int width = p.width();
|
||||||
|
|
||||||
foreach(QGraphicsItem * itemToMove, coversScene->items())
|
foreach(QGraphicsItem * itemToMove, coversScene->items())
|
||||||
{
|
{
|
||||||
QTimeLine *timer = new QTimeLine(400);
|
QTimeLine *timer = new QTimeLine(400);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user