# HG changeset patch # User Andre Heinecke # Date 1395836949 -3600 # Node ID 60c5df8e79809d798bc2aa547d1b3bbfc3bd3e4e # Parent 0861069fd6d09321f5be717808d151d1ec8b262b Reinitialize certificatelist when readFile is called diff -r 0861069fd6d0 -r 60c5df8e7980 ui/certificatelist.cpp --- a/ui/certificatelist.cpp Wed Mar 26 12:52:53 2014 +0100 +++ b/ui/certificatelist.cpp Wed Mar 26 13:29:09 2014 +0100 @@ -13,6 +13,11 @@ char *data = NULL; size_t size = 0; + mCertificatesRemove.clear(); + mCertificatesInstall.clear(); + mDate = QDateTime(); + mData = QString(); + mStatus = read_and_verify_list(fileName, &data, &size); if (!isValid()) { diff -r 0861069fd6d0 -r 60c5df8e7980 ui/certificatelist.h --- a/ui/certificatelist.h Wed Mar 26 12:52:53 2014 +0100 +++ b/ui/certificatelist.h Wed Mar 26 13:29:09 2014 +0100 @@ -54,7 +54,6 @@ const QString& rawData() const {return mData;} private: - QString mFileName; QList mCertificatesInstall; QList mCertificatesRemove; QString mData; diff -r 0861069fd6d0 -r 60c5df8e7980 ui/tests/certlistparsertest.cpp --- a/ui/tests/certlistparsertest.cpp Wed Mar 26 12:52:53 2014 +0100 +++ b/ui/tests/certlistparsertest.cpp Wed Mar 26 13:29:09 2014 +0100 @@ -54,9 +54,10 @@ Certificate cert; QVERIFY(!cert.isValid()); - CertificateList *certList2= testWithFile(fname); - const QList instList2 = certList2->getInstallCertificates(); - const QList remoList2 = certList2->getRemoveCertificates(); + certList->readList(fileName.toLocal8Bit().data()); + + const QList instList2 = certList->getInstallCertificates(); + const QList remoList2 = certList->getRemoveCertificates(); QVERIFY(instLines.size() == instList2.size()); QVERIFY(remoLines.size() == remoList2.size());