Fix potential crash and extra open page on initial help start.

Reviewed-by: ck
This commit is contained in:
kh1
2010-10-12 16:53:00 +02:00
parent 483d369c20
commit f707cfd834
2 changed files with 8 additions and 8 deletions

View File

@@ -177,7 +177,8 @@ void OpenPagesManager::setupInitialPages()
CentralWidget::instance()->addPage(m_model->pageAt(i));
emit pagesChanged();
setCurrentPage(initialPage);
setCurrentPage((initialPage >= m_model->rowCount())
? m_model->rowCount() - 1 : initialPage);
m_openPagesSwitcher->selectCurrentPage();
}