# HG changeset patch # User Raimund Renkert # Date 1397138147 -7200 # Node ID b0a274f4f9e23d5cae44b92c3ec48af4bef44bc5 # Parent e6aa82466420bca445aa918e2e5512879a27bfb3 Added setter to certificate to change the install/remove state. diff -r e6aa82466420 -r b0a274f4f9e2 ui/certificate.cpp --- a/ui/certificate.cpp Thu Apr 10 14:14:56 2014 +0200 +++ b/ui/certificate.cpp Thu Apr 10 15:55:47 2014 +0200 @@ -97,3 +97,13 @@ } return ret; } + +void Certificate::setInstallCert(bool install) +{ + if (install && mBaseLine.startsWith("R:")) { + mBaseLine.replace(0, 1, "I"); + } + else if (!install && mBaseLine.startsWith("I:")) { + mBaseLine.replace(0, 1, "R"); + } +} diff -r e6aa82466420 -r b0a274f4f9e2 ui/certificate.h --- a/ui/certificate.h Thu Apr 10 14:14:56 2014 +0200 +++ b/ui/certificate.h Thu Apr 10 15:55:47 2014 +0200 @@ -70,6 +70,12 @@ **/ bool isInstallCert() const {return mBaseLine.startsWith("I:");} + /** @brief Set the install instruction for this certificate. + * + * Set the base 64 line prefix to "I:" or "R:". + **/ + void setInstallCert(bool install); + /** @brief get the subject OU from the certificate */ QString subjectOU() const {return mSubjectOU;}