From 0c2a63e2d97e7c5ee34aae9594643d02b8445b55 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 22 Oct 2009 15:48:38 +0200 Subject: [PATCH] bat: Don't set Expire field unless LastWritten is ok --- bacula/src/qt-console/mediainfo/mediainfo.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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()); -- 2.39.5