[PC-BSD Commits] r18901 - pcbsd/current/src-qt4/warden-gui

svn at pcbsd.org svn at pcbsd.org
Thu Sep 6 07:52:45 PDT 2012


Author: kris
Date: 2012-09-06 14:52:45 +0000 (Thu, 06 Sep 2012)
New Revision: 18901

Modified:
   pcbsd/current/src-qt4/warden-gui/dialogwarden.cpp
Log:

Make the GUI support old style snapshot tags and new



Modified: pcbsd/current/src-qt4/warden-gui/dialogwarden.cpp
===================================================================
--- pcbsd/current/src-qt4/warden-gui/dialogwarden.cpp	2012-09-06 14:52:36 UTC (rev 18900)
+++ pcbsd/current/src-qt4/warden-gui/dialogwarden.cpp	2012-09-06 14:52:45 UTC (rev 18901)
@@ -1239,7 +1239,7 @@
       tmp.section("-", 0, 0).toInt(&ok);
       tmp.section("-", 1, 1).toInt(&ok2);
       if (ok && ok2) {
-         snapshotList << tmp.section("-", 0, 1);
+         snapshotList << tmp;
       }
    }
 
@@ -1340,8 +1340,17 @@
 
 QString dialogWarden::getSnapDateReadable(QString time)
 {
-   QDate date = QDate::fromString(time.section("-", 0, 0), "yyyyMMdd");
-   QTime timestr = QTime::fromString(time.section("-", 1, 1), "hhmmss");
+   QDate date;
+   QTime timestr;
+   if ( time.count('-') == 1 ) {
+     // Old Style
+     date = QDate::fromString(time.section("-", 0, 0), "yyyyMMdd");
+     timestr = QTime::fromString(time.section("-", 1, 1), "hhmmss");
+   } else {
+     // New Style
+     date = QDate::fromString(time.section("-", 0, 2), "yyyy-MM-dd");
+     timestr = QTime::fromString(time.section("-", 3, 5), "hh-mm-ss");
+   }
    
    return QString(date.toString("ddd MMMM d',' yyyy") + " @ " + timestr.toString("h:mm:ss ap"));
 }



More information about the Commits mailing list