kde-extraapps/okular/core/pagecontroller.cpp
Ivailo Monev 22fd0cca5f okular: use QThread instead of ThreadWeaver for image rotation jobs
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2016-04-23 00:50:43 +00:00

51 lines
1.4 KiB
C++

/***************************************************************************
* Copyright (C) 2007 by Pino Toscano <pino@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#include "pagecontroller_p.h"
// qt/kde includes
#include <kglobal.h>
// local includes
#include "page_p.h"
#include "rotationjob_p.h"
using namespace Okular;
PageController::PageController()
: QObject()
{
}
PageController::~PageController()
{
}
void PageController::addRotationJob(RotationJob *job)
{
connect( job, SIGNAL(done(QThread*)),
this, SLOT(imageRotationDone(QThread*)) );
job->start();
}
void PageController::imageRotationDone(QThread *j)
{
RotationJob *job = static_cast< RotationJob * >( j );
if ( job->page() )
{
job->page()->imageRotationDone( job );
emit rotationFinished( job->page()->m_number, job->page()->m_page );
}
job->deleteLater();
}
#include "moc_pagecontroller_p.cpp"