Commit b2472bef authored by Pino Toscano's avatar Pino Toscano

check that the rotation page notification really refers to a page of a document

fixes crash when rotating documents opened in one of more than one okular tabs in konqueror

svn path=/trunk/KDE/kdegraphics/okular/; revision=989681
parent 377470ab
......@@ -890,8 +890,12 @@ void DocumentPrivate::sendGeneratorRequest()
}
}
void DocumentPrivate::rotationFinished( int page )
void DocumentPrivate::rotationFinished( int page, Okular::Page *okularPage )
{
Okular::Page *wantedPage = m_pagesVector.value( page, 0 );
if ( !wantedPage || wantedPage != okularPage )
return;
QMap< int, DocumentObserver * >::const_iterator it = m_observers.constBegin(), end = m_observers.constEnd();
for ( ; it != end ; ++ it ) {
(*it)->notifyPageChanged( page, DocumentObserver::Pixmap | DocumentObserver::Annotations );
......
......@@ -699,7 +699,7 @@ class OKULAR_EXPORT Document : public QObject
Q_PRIVATE_SLOT( d, void saveDocumentInfo() const )
Q_PRIVATE_SLOT( d, void slotTimedMemoryCheck() )
Q_PRIVATE_SLOT( d, void sendGeneratorRequest() )
Q_PRIVATE_SLOT( d, void rotationFinished( int page ) )
Q_PRIVATE_SLOT( d, void rotationFinished( int page, Okular::Page *okularPage ) )
Q_PRIVATE_SLOT( d, void fontReadingProgress( int page ) )
Q_PRIVATE_SLOT( d, void fontReadingGotFont( const Okular::FontInfo& font ) )
Q_PRIVATE_SLOT( d, void slotGeneratorConfigChanged( const QString& ) )
......
......@@ -118,7 +118,7 @@ class DocumentPrivate
void saveDocumentInfo() const;
void slotTimedMemoryCheck();
void sendGeneratorRequest();
void rotationFinished( int page );
void rotationFinished( int page, Okular::Page *okularPage );
void fontReadingProgress( int page );
void fontReadingGotFont( const Okular::FontInfo& font );
void slotGeneratorConfigChanged( const QString& );
......
......@@ -52,7 +52,7 @@ void PageController::imageRotationDone(ThreadWeaver::Job *j)
{
job->page()->imageRotationDone( job );
emit rotationFinished( job->page()->m_number );
emit rotationFinished( job->page()->m_number, job->page()->m_page );
}
job->deleteLater();
......
......@@ -38,7 +38,7 @@ class PageController : public QObject
void addRotationJob( RotationJob *job );
signals:
void rotationFinished( int page );
void rotationFinished( int page, Okular::Page *okularPage );
private slots:
void imageRotationDone(ThreadWeaver::Job*);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment