mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -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)
|
||||
{
|
||||
updatingCovers = true;
|
||||
QGraphicsItem * last = coversScene->items().last();
|
||||
int width = p.width();
|
||||
if(previousWidth > 3000)
|
||||
|
||||
foreach(QGraphicsItem * itemToRemove, coversScene->items())
|
||||
{
|
||||
coversScene->removeItem(last);
|
||||
delete last;
|
||||
QGraphicsPixmapItem * last = dynamic_cast<QGraphicsPixmapItem *>(itemToRemove);
|
||||
|
||||
if((last->pos().x()+last->pixmap().width())<=0)
|
||||
{
|
||||
coversScene->removeItem(last);
|
||||
delete last;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
int width = p.width();
|
||||
|
||||
foreach(QGraphicsItem * itemToMove, coversScene->items())
|
||||
{
|
||||
QTimeLine *timer = new QTimeLine(400);
|
||||
|
Loading…
Reference in New Issue
Block a user