changeset 352:b0a274f4f9e2

Added setter to certificate to change the install/remove state.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 10 Apr 2014 15:55:47 +0200
parents e6aa82466420
children 666abcfab229
files ui/certificate.cpp ui/certificate.h
diffstat 2 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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");
+    }
+}
--- 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;}
 

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