comparison ui/certificatelist.cpp @ 472:cf25bb040186

Change date format to ISO as specificed for the certificate list
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 23 Apr 2014 16:53:28 +0000
parents 17e1c8f37d72
children
comparison
equal deleted inserted replaced
471:dd54c02fc28a 472:cf25bb040186
45 qDebug() << "Invalid Format Version"; 45 qDebug() << "Invalid Format Version";
46 mStatus = IncompatibleVersion; 46 mStatus = IncompatibleVersion;
47 return mStatus; 47 return mStatus;
48 } 48 }
49 } else if (curLine.startsWith("D:")) { 49 } else if (curLine.startsWith("D:")) {
50 bool ok = false;
51 qlonglong timestamp = 0;
52
53 curLine.remove(0, 2); 50 curLine.remove(0, 2);
54 timestamp = curLine.toLongLong(&ok); 51 mDate = QDateTime::fromString(curLine, Qt::ISODate);
55 if (!ok) { 52 if (!mDate.isValid()) {
56 qDebug() << "Invalid Date"; 53 qDebug() << "Invalid Date: " << curLine;
57 mStatus = InvalidFormat; 54 mStatus = InvalidFormat;
58 return mStatus; 55 return mStatus;
59 } 56 }
60
61 mDate = QDateTime::fromMSecsSinceEpoch(timestamp * 1000);
62 } else if (curLine.startsWith("I:")) { 57 } else if (curLine.startsWith("I:")) {
63 mCertificates << Certificate(curLine); 58 mCertificates << Certificate(curLine);
64 } else if (curLine.startsWith("R:")) { 59 } else if (curLine.startsWith("R:")) {
65 mCertificates << Certificate(curLine); 60 mCertificates << Certificate(curLine);
66 } else if (curLine.startsWith("S:")) { 61 } else if (curLine.startsWith("S:")) {

http://wald.intevation.org/projects/trustbridge/