Mercurial > trustbridge
diff ui/certificatelist.cpp @ 249:6a7eb102716d
Remove code duplication by unifying the certificatelist.
You should now check for isInstallCert to determine wether this
certificate should be installed or removed.
Leaving the getInstallCertificates and getRemoveCertificates
in place for compatibilty would have been easier to keep the
tests stable.
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Mon, 31 Mar 2014 08:06:17 +0000 |
parents | 60c5df8e7980 |
children | 17e1c8f37d72 |
line wrap: on
line diff
--- a/ui/certificatelist.cpp Mon Mar 31 08:03:20 2014 +0000 +++ b/ui/certificatelist.cpp Mon Mar 31 08:06:17 2014 +0000 @@ -13,10 +13,10 @@ char *data = NULL; size_t size = 0; - mCertificatesRemove.clear(); - mCertificatesInstall.clear(); + mCertificates.clear(); mDate = QDateTime(); mData = QString(); + mFileName = QString::fromUtf8(fileName); mStatus = read_and_verify_list(fileName, &data, &size); @@ -53,9 +53,9 @@ mDate = QDateTime::fromMSecsSinceEpoch(timestamp * 1000); } else if (curLine.startsWith("I:")) { - mCertificatesInstall << Certificate(curLine); + mCertificates << Certificate(curLine); } else if (curLine.startsWith("R:")) { - mCertificatesRemove << Certificate(curLine); + mCertificates << Certificate(curLine); } else if (curLine.startsWith("S:")) { // Signature is verified in read_and_verify_list continue; @@ -71,10 +71,7 @@ readList(fileName); } -const QList<Certificate>& CertificateList::getInstallCertificates() const { - return mCertificatesInstall; +const QList<Certificate>& CertificateList::getCertificates() const +{ + return mCertificates; } - -const QList<Certificate>& CertificateList::getRemoveCertificates() const { - return mCertificatesRemove; -}