]> git.sur5r.net Git - bacula/bacula/commitdiff
bat: Don't set Expire field unless LastWritten is ok
authorEric Bollengier <eric@eb.homelinux.org>
Thu, 22 Oct 2009 13:48:38 +0000 (15:48 +0200)
committerEric Bollengier <eric@eb.homelinux.org>
Thu, 22 Oct 2009 13:48:38 +0000 (15:48 +0200)
bacula/src/qt-console/mediainfo/mediainfo.cpp

index 2de3f2128d45eab621da612697118335b8d1c123..7ff888cf56179fb3648333969e2d24e0a5fac628 100644 (file)
@@ -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());