mirror of
https://invent.kde.org/graphics/okular
synced 2024-10-02 14:14:10 +00:00
delay the real creation + initialization of the weaver to the real needed moment
svn path=/trunk/KDE/kdegraphics/okular/; revision=712637
This commit is contained in:
parent
231839f344
commit
ed413cb275
|
@ -24,9 +24,6 @@ using namespace Okular;
|
|||
PageController::PageController()
|
||||
: QObject()
|
||||
{
|
||||
connect( ThreadWeaver::Weaver::instance(),
|
||||
SIGNAL( jobDone(ThreadWeaver::Job*) ),
|
||||
SLOT( imageRotationDone(ThreadWeaver::Job*) ) );
|
||||
}
|
||||
|
||||
PageController::~PageController()
|
||||
|
@ -40,6 +37,7 @@ PageController * PageController::self()
|
|||
|
||||
void PageController::addRotationJob(RotationJob *job)
|
||||
{
|
||||
initWeaver();
|
||||
ThreadWeaver::Weaver::instance()->enqueue(job);
|
||||
}
|
||||
|
||||
|
@ -60,4 +58,16 @@ void PageController::imageRotationDone(ThreadWeaver::Job *j)
|
|||
job->deleteLater();
|
||||
}
|
||||
|
||||
void PageController::initWeaver()
|
||||
{
|
||||
static bool weaverInited = false;
|
||||
if ( weaverInited )
|
||||
return;
|
||||
|
||||
connect( ThreadWeaver::Weaver::instance(), SIGNAL( jobDone(ThreadWeaver::Job*) ),
|
||||
this, SLOT( imageRotationDone(ThreadWeaver::Job*) ) );
|
||||
|
||||
weaverInited = true;
|
||||
}
|
||||
|
||||
#include "pagecontroller_p.moc"
|
||||
|
|
|
@ -42,6 +42,9 @@ class PageController : public QObject
|
|||
|
||||
private slots:
|
||||
void imageRotationDone(ThreadWeaver::Job*);
|
||||
|
||||
private:
|
||||
void initWeaver();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue