From: Eric Bollengier Date: Thu, 22 Oct 2009 13:48:38 +0000 (+0200) Subject: bat: Don't set Expire field unless LastWritten is ok X-Git-Tag: Release-5.0.0~282^2~4 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0c2a63e2d97e7c5ee34aae9594643d02b8445b55;p=bacula%2Fbacula bat: Don't set Expire field unless LastWritten is ok --- diff --git a/bacula/src/qt-console/mediainfo/mediainfo.cpp b/bacula/src/qt-console/mediainfo/mediainfo.cpp index 2de3f2128d..7ff888cf56 100644 --- a/bacula/src/qt-console/mediainfo/mediainfo.cpp +++ b/bacula/src/qt-console/mediainfo/mediainfo.cpp @@ -186,12 +186,14 @@ void MediaInfo::populateForm() edit_utime(stat.toULongLong(), buf, sizeof(buf)); label_VolRetention->setText(QString(buf)); - t = str_to_utime(LastWritten.toAscii().data()); - t = t + stat.toULongLong(); - ttime = t; - localtime_r(&ttime, &tm); - strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", &tm); - label_Expire->setText(QString(buf)); + if (LastWritten != "") { + t = str_to_utime(LastWritten.toAscii().data()); + t = t + stat.toULongLong(); + ttime = t; + localtime_r(&ttime, &tm); + strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", &tm); + label_Expire->setText(QString(buf)); + } label_Online->setPixmap(QPixmap(":/images/inflag"+fld.next()+".png")); // label_VolFiles->setText(fld.next()); // label_VolErrors->setText(fld.next());