fixed crash due to the document metadata

preferencesAboutTextFull
Claudio Valerio 12 years ago
parent bc941dd41a
commit c62c84fbfb
  1. 2
      src/document/UBDocumentProxy.cpp
  2. 8
      src/gui/UBTeacherGuideWidget.cpp

@ -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));
}
}

Loading…
Cancel
Save