# HG changeset patch # User Andre Heinecke # Date 1395332487 0 # Node ID 00a93409e93e139838e08ecf4a7f2cbc725f8086 # Parent ba8a548ff25231f93358c064ed69b9457e0095e6 Keep raw data around to later pass it to the installer diff -r ba8a548ff252 -r 00a93409e93e ui/certificatelist.cpp --- a/ui/certificatelist.cpp Thu Mar 20 16:20:44 2014 +0000 +++ b/ui/certificatelist.cpp Thu Mar 20 16:21:27 2014 +0000 @@ -22,13 +22,13 @@ // Take the data into the Qt Universe where memory is plentiful // and CPU's are fast :) - QStringList lines = QString::fromLatin1(data, size).split("\n"); + mData = QString::fromLatin1(data, size); free(data); data = NULL; + QStringList lines = mData.split("\n"); for (int i = 0; i < lines.size(); ++i) { QString curLine = lines[i].trimmed(); - qDebug() << "Reading line: " << curLine; if (curLine.startsWith("F:")) { if (curLine.right(1) != PARSER_VERSION) { qDebug() << "Invalid Format Version"; @@ -49,11 +49,9 @@ mDate = QDateTime::fromMSecsSinceEpoch(timestamp * 1000); } else if (curLine.startsWith("I:")) { - mCertificatesInstall << Certificate( - QByteArray::fromBase64(curLine.remove(0,2).toLatin1())); + mCertificatesInstall << Certificate(curLine); } else if (curLine.startsWith("R:")) { - mCertificatesInstall << Certificate( - QByteArray::fromBase64(curLine.remove(0,2).toLatin1())); + mCertificatesInstall << Certificate(curLine); } else if (curLine.startsWith("S:")) { // Signature is verified in read_and_verify_list continue; diff -r ba8a548ff252 -r 00a93409e93e ui/certificatelist.h --- a/ui/certificatelist.h Thu Mar 20 16:20:44 2014 +0000 +++ b/ui/certificatelist.h Thu Mar 20 16:21:27 2014 +0000 @@ -44,13 +44,20 @@ */ bool isValid() const {return mStatus == Valid;} + /* @brief get a list of certificate objects that should be installed */ const QList& getInstallCertificates() const; + + /* @brief get a list of certificate objects that should be removed */ const QList& getRemoveCertificates() const; + /* @brief get the raw certificate list */ + const QString& rawData() const {return mData;} + private: QString mFileName; QList mCertificatesInstall; QList mCertificatesRemove; + QString mData; list_status_t mStatus; QDateTime mDate; };