fixed wrong cover being loaded after deleting a comic

This commit is contained in:
Luis Ángel San Martín
2013-12-22 12:29:36 +01:00
parent 6624b0d483
commit 72f4fbd658
4 changed files with 53 additions and 9 deletions

View File

@ -691,11 +691,15 @@ CFImage YACReaderFlowGL::getCurrentSelected()
void YACReaderFlowGL::replace(char *name, GLuint Tex, float x, float y,int item)
{
Q_UNUSED(name)
cfImages[item].img = Tex;
cfImages[item].width = x;
cfImages[item].height = y;
//strcpy(cfImages[item].name,name);
loaded[item]=true;
if(cfImages[item].index == item)
{
cfImages[item].img = Tex;
cfImages[item].width = x;
cfImages[item].height = y;
loaded[item]=true;
}
else
loaded[item]=false;
}
void YACReaderFlowGL::populate(int n)
@ -1081,7 +1085,7 @@ void YACReaderComicFlowGL::updateImageData()
CFImages[idx].height = y;
CFImages[idx].img = worker->resultTexture;
strcpy(CFImages[idx].name,"cover");*/
loaded[idx] = true;
//loaded[idx] = true;
//numImagesLoaded++;
}
}
@ -1134,6 +1138,14 @@ void YACReaderComicFlowGL::updateImageData()
}
}
void YACReaderComicFlowGL::remove(int item)
{
worker->lock();
worker->reset();
YACReaderFlowGL::remove(item);
worker->unlock();
}
YACReaderPageFlowGL::YACReaderPageFlowGL(QWidget *parent,struct Preset p )
:YACReaderFlowGL(parent,p)
@ -1312,6 +1324,16 @@ void ImageLoaderGL::generate(int index, const QString& fileName)
}
}
void ImageLoaderGL::lock()
{
mutex.lock();
}
void ImageLoaderGL::unlock()
{
mutex.unlock();
}
void ImageLoaderGL::run()
{
for(;;)