2007-03-24 10:47:22 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* 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. *
|
|
|
|
***************************************************************************/
|
|
|
|
|
2007-04-19 18:30:20 +00:00
|
|
|
#include "pagecontroller_p.h"
|
|
|
|
|
2007-03-24 10:47:22 +00:00
|
|
|
// local includes
|
|
|
|
#include "page_p.h"
|
2007-07-04 14:39:52 +00:00
|
|
|
#include "rotationjob_p.h"
|
2007-03-24 10:47:22 +00:00
|
|
|
|
2014-08-09 18:44:25 +00:00
|
|
|
#include <threadweaver/queueing.h>
|
|
|
|
|
2007-03-24 10:47:22 +00:00
|
|
|
using namespace Okular;
|
|
|
|
|
|
|
|
PageController::PageController()
|
|
|
|
: QObject()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
PageController::~PageController()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-07-04 16:55:33 +00:00
|
|
|
void PageController::addRotationJob(RotationJob *job)
|
2007-03-24 10:47:22 +00:00
|
|
|
{
|
2014-08-09 18:44:25 +00:00
|
|
|
connect( job, SIGNAL(done(ThreadWeaver::JobPointer)),
|
|
|
|
this, SLOT(imageRotationDone(ThreadWeaver::JobPointer)) );
|
|
|
|
ThreadWeaver::enqueue(&m_weaver, job);
|
2007-07-04 16:55:33 +00:00
|
|
|
}
|
|
|
|
|
2014-08-09 18:44:25 +00:00
|
|
|
void PageController::imageRotationDone(const ThreadWeaver::JobPointer &j)
|
2007-07-04 16:55:33 +00:00
|
|
|
{
|
2014-08-09 18:44:25 +00:00
|
|
|
RotationJob *job = static_cast< RotationJob * >( j.data() );
|
2007-03-24 10:47:22 +00:00
|
|
|
|
|
|
|
if ( job->page() )
|
|
|
|
{
|
|
|
|
job->page()->imageRotationDone( job );
|
|
|
|
|
2009-06-30 17:21:55 +00:00
|
|
|
emit rotationFinished( job->page()->m_number, job->page()->m_page );
|
2007-03-24 10:47:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
job->deleteLater();
|
|
|
|
}
|
|
|
|
|
2014-08-08 22:00:07 +00:00
|
|
|
#include "moc_pagecontroller_p.cpp"
|