comparison ui/certificatelist.cpp @ 84:00a93409e93e

Keep raw data around to later pass it to the installer
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 20 Mar 2014 16:21:27 +0000
parents 1f27d6db5ee3
children 37580703a870
comparison
equal deleted inserted replaced
83:ba8a548ff252 84:00a93409e93e
20 return mStatus; 20 return mStatus;
21 } 21 }
22 22
23 // Take the data into the Qt Universe where memory is plentiful 23 // Take the data into the Qt Universe where memory is plentiful
24 // and CPU's are fast :) 24 // and CPU's are fast :)
25 QStringList lines = QString::fromLatin1(data, size).split("\n"); 25 mData = QString::fromLatin1(data, size);
26 free(data); 26 free(data);
27 data = NULL; 27 data = NULL;
28 QStringList lines = mData.split("\n");
28 29
29 for (int i = 0; i < lines.size(); ++i) { 30 for (int i = 0; i < lines.size(); ++i) {
30 QString curLine = lines[i].trimmed(); 31 QString curLine = lines[i].trimmed();
31 qDebug() << "Reading line: " << curLine;
32 if (curLine.startsWith("F:")) { 32 if (curLine.startsWith("F:")) {
33 if (curLine.right(1) != PARSER_VERSION) { 33 if (curLine.right(1) != PARSER_VERSION) {
34 qDebug() << "Invalid Format Version"; 34 qDebug() << "Invalid Format Version";
35 mStatus = IncompatibleVersion; 35 mStatus = IncompatibleVersion;
36 return mStatus; 36 return mStatus;
47 return mStatus; 47 return mStatus;
48 } 48 }
49 49
50 mDate = QDateTime::fromMSecsSinceEpoch(timestamp * 1000); 50 mDate = QDateTime::fromMSecsSinceEpoch(timestamp * 1000);
51 } else if (curLine.startsWith("I:")) { 51 } else if (curLine.startsWith("I:")) {
52 mCertificatesInstall << Certificate( 52 mCertificatesInstall << Certificate(curLine);
53 QByteArray::fromBase64(curLine.remove(0,2).toLatin1()));
54 } else if (curLine.startsWith("R:")) { 53 } else if (curLine.startsWith("R:")) {
55 mCertificatesInstall << Certificate( 54 mCertificatesInstall << Certificate(curLine);
56 QByteArray::fromBase64(curLine.remove(0,2).toLatin1()));
57 } else if (curLine.startsWith("S:")) { 55 } else if (curLine.startsWith("S:")) {
58 // Signature is verified in read_and_verify_list 56 // Signature is verified in read_and_verify_list
59 continue; 57 continue;
60 } else if (!curLine.isEmpty()){ 58 } else if (!curLine.isEmpty()){
61 qDebug () << "Don't know how to handle: " << curLine; 59 qDebug () << "Don't know how to handle: " << curLine;

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