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);
|
flow->setSlideSize(imageSize);
|
||||||
connect(flow, SIGNAL(centerIndexChanged(int)), this, SLOT(setPageNumber(int)));
|
connect(flow, SIGNAL(centerIndexChanged(int)), this, SLOT(setPageNumber(int)));
|
||||||
connect(flow, SIGNAL(selected(unsigned int)), this, SIGNAL(goToPage(unsigned 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(goTo(unsigned int)), this, SIGNAL(goToPage(unsigned int)));
|
||||||
connect(toolBar, SIGNAL(setCenter(unsigned int)), flow, SLOT(showSlide(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;
|
numImagesLoaded = 0;
|
||||||
|
|
||||||
connect(flow, SIGNAL(centerIndexChanged(int)), this, SLOT(preload()));
|
|
||||||
connect(flow, SIGNAL(centerIndexChangedSilent(int)), this, SLOT(preload()));
|
|
||||||
|
|
||||||
ready = true;
|
ready = true;
|
||||||
worker->reset();
|
worker->reset();
|
||||||
|
|
||||||
@ -244,7 +243,7 @@ PageLoader::~PageLoader()
|
|||||||
|
|
||||||
bool PageLoader::busy() const
|
bool PageLoader::busy() const
|
||||||
{
|
{
|
||||||
return isRunning() ? working : false;
|
return isRunning() ? working.load() : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PageLoader::generate(int index, QSize size, const QByteArray &rImage)
|
void PageLoader::generate(int index, QSize size, const QByteArray &rImage)
|
||||||
@ -283,8 +282,8 @@ void PageLoader::run()
|
|||||||
mutex->unlock();
|
mutex->unlock();
|
||||||
|
|
||||||
mutex->lock();
|
mutex->lock();
|
||||||
this->working = false;
|
|
||||||
this->img = image;
|
this->img = image;
|
||||||
|
this->working = false;
|
||||||
mutex->unlock();
|
mutex->unlock();
|
||||||
|
|
||||||
// put to sleep
|
// put to sleep
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
#include <QWaitCondition>
|
#include <QWaitCondition>
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
|
|
||||||
|
#include <atomic>
|
||||||
|
|
||||||
class QLineEdit;
|
class QLineEdit;
|
||||||
class QPushButton;
|
class QPushButton;
|
||||||
class QPixmap;
|
class QPixmap;
|
||||||
@ -89,7 +91,7 @@ private:
|
|||||||
QWaitCondition condition;
|
QWaitCondition condition;
|
||||||
|
|
||||||
bool restart;
|
bool restart;
|
||||||
bool working;
|
std::atomic<bool> working;
|
||||||
int idx;
|
int idx;
|
||||||
|
|
||||||
QSize size;
|
QSize size;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user