1 /***************************************************************************
2 * Copyright (C) 2007 by Pino Toscano <pino@kde.org> *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 ***************************************************************************/
10 #include "pagecontroller_p.h"
14 #include <threadweaver/ThreadWeaver.h>
18 #include "rotationjob_p.h"
20 K_GLOBAL_STATIC( Okular::PageController
, page_controller_self
)
22 using namespace Okular
;
24 PageController::PageController()
29 PageController::~PageController()
33 PageController
* PageController::self()
35 return page_controller_self
;
38 void PageController::addRotationJob(RotationJob
*job
)
41 ThreadWeaver::Weaver::instance()->enqueue(job
);
44 void PageController::imageRotationDone(ThreadWeaver::Job
*j
)
46 RotationJob
*job
= qobject_cast
< RotationJob
* >(j
);
53 job
->page()->imageRotationDone( job
);
55 emit
rotationFinished( job
->page()->m_number
);
61 void PageController::initWeaver()
63 static bool weaverInited
= false;
67 connect( ThreadWeaver::Weaver::instance(), SIGNAL( jobDone(ThreadWeaver::Job
*) ),
68 this, SLOT( imageRotationDone(ThreadWeaver::Job
*) ) );
73 #include "pagecontroller_p.moc"