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
remotes/origin/KDE/4.4
Pino Toscano 17 years ago
parent 377470ab15
commit b2472bef0d
  1. 6
      core/document.cpp
  2. 2
      core/document.h
  3. 2
      core/document_p.h
  4. 2
      core/pagecontroller.cpp
  5. 2
      core/pagecontroller_p.h

@ -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(); QMap< int, DocumentObserver * >::const_iterator it = m_observers.constBegin(), end = m_observers.constEnd();
for ( ; it != end ; ++ it ) { for ( ; it != end ; ++ it ) {
(*it)->notifyPageChanged( page, DocumentObserver::Pixmap | DocumentObserver::Annotations ); (*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 saveDocumentInfo() const )
Q_PRIVATE_SLOT( d, void slotTimedMemoryCheck() ) Q_PRIVATE_SLOT( d, void slotTimedMemoryCheck() )
Q_PRIVATE_SLOT( d, void sendGeneratorRequest() ) 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 fontReadingProgress( int page ) )
Q_PRIVATE_SLOT( d, void fontReadingGotFont( const Okular::FontInfo& font ) ) Q_PRIVATE_SLOT( d, void fontReadingGotFont( const Okular::FontInfo& font ) )
Q_PRIVATE_SLOT( d, void slotGeneratorConfigChanged( const QString& ) ) Q_PRIVATE_SLOT( d, void slotGeneratorConfigChanged( const QString& ) )

@ -118,7 +118,7 @@ class DocumentPrivate
void saveDocumentInfo() const; void saveDocumentInfo() const;
void slotTimedMemoryCheck(); void slotTimedMemoryCheck();
void sendGeneratorRequest(); void sendGeneratorRequest();
void rotationFinished( int page ); void rotationFinished( int page, Okular::Page *okularPage );
void fontReadingProgress( int page ); void fontReadingProgress( int page );
void fontReadingGotFont( const Okular::FontInfo& font ); void fontReadingGotFont( const Okular::FontInfo& font );
void slotGeneratorConfigChanged( const QString& ); void slotGeneratorConfigChanged( const QString& );

@ -52,7 +52,7 @@ void PageController::imageRotationDone(ThreadWeaver::Job *j)
{ {
job->page()->imageRotationDone( job ); job->page()->imageRotationDone( job );
emit rotationFinished( job->page()->m_number ); emit rotationFinished( job->page()->m_number, job->page()->m_page );
} }
job->deleteLater(); job->deleteLater();

@ -38,7 +38,7 @@ class PageController : public QObject
void addRotationJob( RotationJob *job ); void addRotationJob( RotationJob *job );
signals: signals:
void rotationFinished( int page ); void rotationFinished( int page, Okular::Page *okularPage );
private slots: private slots:
void imageRotationDone(ThreadWeaver::Job*); void imageRotationDone(ThreadWeaver::Job*);

Loading…
Cancel
Save