mirror of
https://invent.kde.org/graphics/okular
synced 2024-09-12 20:51:17 +00:00
QML PageItem: Handle document path changes
PageItem works quite well if the DocumentItem has the path on construction, but it does not update if the path is initially blank and then later changed. REVIEW: 115751
This commit is contained in:
parent
e1f7b5c512
commit
a034265e75
|
@ -118,6 +118,8 @@ void PageItem::setDocument(DocumentItem *doc)
|
|||
setPageNumber(0);
|
||||
emit documentChanged();
|
||||
m_redrawTimer->start();
|
||||
|
||||
connect(doc, SIGNAL(pathChanged()), this, SLOT(documentPathChanged()));
|
||||
}
|
||||
|
||||
int PageItem::pageNumber() const
|
||||
|
@ -380,6 +382,15 @@ void PageItem::contentYChanged()
|
|||
m_viewPort.rePos.normalizedY = m_flickable.data()->property("contentY").toReal() / (height() - m_flickable.data()->height());
|
||||
}
|
||||
|
||||
void PageItem::documentPathChanged()
|
||||
{
|
||||
m_page = 0;
|
||||
setPageNumber(0);
|
||||
|
||||
m_redrawTimer->start();
|
||||
}
|
||||
|
||||
|
||||
void PageItem::setIsThumbnail(bool thumbnail)
|
||||
{
|
||||
if (thumbnail == m_isThumbnail) {
|
||||
|
|
|
@ -153,6 +153,7 @@ protected:
|
|||
|
||||
private Q_SLOTS:
|
||||
void delayedRedraw();
|
||||
void documentPathChanged();
|
||||
void pageHasChanged(int page, int flags);
|
||||
void checkBookmarksChanged();
|
||||
void contentXChanged();
|
||||
|
|
Loading…
Reference in a new issue