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:
Pino Toscano 2007-09-14 23:14:53 +00:00
parent 231839f344
commit ed413cb275
2 changed files with 16 additions and 3 deletions

View file

@ -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"

View file

@ -42,6 +42,9 @@ class PageController : public QObject
private slots:
void imageRotationDone(ThreadWeaver::Job*);
private:
void initWeaver();
};
}