pdfworker: Renderer copy constructor missed max mem field

This commit is contained in:
Albert S. 2019-08-12 10:26:16 +02:00
parent 9e0fbcd776
commit ae178e34e5

View File

@ -26,15 +26,15 @@ struct Renderer
this->scaleX = scaleX; this->scaleX = scaleX;
this->scaleY = scaleY; this->scaleY = scaleY;
this->maxTotalPreviewImageMemUsage = maxPreviewImageMemUsage; this->maxTotalPreviewImageMemUsage = maxPreviewImageMemUsage;
} }
/*we need this one because std::atomic has none, but this is only a functor for /*we need this one because std::atomic has none, but this is only a functor for
concurrentmap, thus, it's ok for it to be half-broken*/ concurrentmap, thus, it's ok for it to be half-broken*/
Renderer(const Renderer &o) Renderer(const Renderer &o)
{ {
this->scaleX = o.scaleX; this->scaleX = o.scaleX;
this->scaleY = o.scaleY; this->scaleY = o.scaleY;
this->maxTotalPreviewImageMemUsage = o.maxTotalPreviewImageMemUsage;
} }
~Renderer() ~Renderer()
@ -114,7 +114,6 @@ QFuture<PdfPreview> PdfWorker::generatePreviews(const QVector<SearchResult> path
QSettings setting; QSettings setting;
qsizetype maxPreviewImageMemUsage = setting.value("maxpreviewimagesmemory", 1024 * 1024 * 1024).toLongLong(); qsizetype maxPreviewImageMemUsage = setting.value("maxpreviewimagesmemory", 1024 * 1024 * 1024).toLongLong();
return QtConcurrent::mapped(previews, Renderer(scaleX, scaleY, maxPreviewImageMemUsage)); return QtConcurrent::mapped(previews, Renderer(scaleX, scaleY, maxPreviewImageMemUsage));
} }