Commit c62c84fb authored by Claudio Valerio's avatar Claudio Valerio

fixed crash due to the document metadata

parent bc941dd4
......@@ -297,6 +297,8 @@ QString UBDocumentProxy::sessionAuthors()
QDateTime UBDocumentProxy::documentDate()
{
qDebug()<< UBSettings::documentDate;
qDebug()<<mMetaDatas;
if(mMetaDatas.contains(UBSettings::documentDate))
return UBStringUtils::fromUtcIsoDate(metaData(UBSettings::documentDate).toString());
return QDateTime::currentDateTime();
......
......@@ -723,10 +723,10 @@ void UBTeacherGuidePageZeroEditionWidget::onActiveSceneChanged()
{
UBDocumentProxy* documentProxy = UBApplication::documentController ? UBApplication::documentController->getCurrentDocument() : 0;
if(UBApplication::documentController && UBApplication::boardController->activeSceneIndex() == 0){
QDateTime creationDate = documentProxy->documentDate();
mpCreationLabel->setText(tr("Created the:") + creationDate.toString(Qt::SystemLocaleShortDate));
QDateTime updatedDate = documentProxy->lastUpdate();
mpLastModifiedLabel->setText(tr("Updated the:") + updatedDate.toString(Qt::SystemLocaleShortDate));
// QDateTime creationDate = documentProxy->documentDate();
// mpCreationLabel->setText(tr("Created the:") + creationDate.toString(Qt::SystemLocaleShortDate));
// QDateTime updatedDate = documentProxy->lastUpdate();
// mpLastModifiedLabel->setText(tr("Updated the:") + updatedDate.toString(Qt::SystemLocaleShortDate));
}
}
......
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