mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
commit
3219d00a28
@ -40,6 +40,8 @@ GoToFlow::GoToFlow(QWidget *parent, FlowType flowType)
|
||||
flow->setSlideSize(imageSize);
|
||||
connect(flow, SIGNAL(centerIndexChanged(int)), this, SLOT(setPageNumber(int)));
|
||||
connect(flow, SIGNAL(selected(unsigned int)), this, SIGNAL(goToPage(unsigned int)));
|
||||
connect(flow, &PictureFlow::centerIndexChanged, this, &GoToFlow::preload);
|
||||
connect(flow, &PictureFlow::centerIndexChangedSilent, this, &GoToFlow::preload);
|
||||
|
||||
connect(toolBar, SIGNAL(goTo(unsigned int)), this, SIGNAL(goToPage(unsigned int)));
|
||||
connect(toolBar, SIGNAL(setCenter(unsigned int)), flow, SLOT(showSlide(unsigned int)));
|
||||
@ -114,9 +116,6 @@ void GoToFlow::setNumSlides(unsigned int slides)
|
||||
|
||||
numImagesLoaded = 0;
|
||||
|
||||
connect(flow, SIGNAL(centerIndexChanged(int)), this, SLOT(preload()));
|
||||
connect(flow, SIGNAL(centerIndexChangedSilent(int)), this, SLOT(preload()));
|
||||
|
||||
ready = true;
|
||||
worker->reset();
|
||||
|
||||
@ -244,7 +243,7 @@ PageLoader::~PageLoader()
|
||||
|
||||
bool PageLoader::busy() const
|
||||
{
|
||||
return isRunning() ? working : false;
|
||||
return isRunning() ? working.load() : false;
|
||||
}
|
||||
|
||||
void PageLoader::generate(int index, QSize size, const QByteArray &rImage)
|
||||
@ -283,8 +282,8 @@ void PageLoader::run()
|
||||
mutex->unlock();
|
||||
|
||||
mutex->lock();
|
||||
this->working = false;
|
||||
this->img = image;
|
||||
this->working = false;
|
||||
mutex->unlock();
|
||||
|
||||
// put to sleep
|
||||
|
@ -9,6 +9,8 @@
|
||||
#include <QWaitCondition>
|
||||
#include <QMutex>
|
||||
|
||||
#include <atomic>
|
||||
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
class QPixmap;
|
||||
@ -89,7 +91,7 @@ private:
|
||||
QWaitCondition condition;
|
||||
|
||||
bool restart;
|
||||
bool working;
|
||||
std::atomic<bool> working;
|
||||
int idx;
|
||||
|
||||
QSize size;
|
||||
|
Loading…
x
Reference in New Issue
Block a user