diff ui/certificatelist.cpp @ 70:64c8c6350e60

Add default constructor to certificatelist. Remove Q_OBJECT use
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 19 Mar 2014 11:31:08 +0000
parents 37fc66967517
children 1dd8e91972a8
line wrap: on
line diff
--- a/ui/certificatelist.cpp	Wed Mar 19 11:30:16 2014 +0000
+++ b/ui/certificatelist.cpp	Wed Mar 19 11:31:08 2014 +0000
@@ -4,7 +4,11 @@
 
 #define PARSER_VERSION "1"
 
-CertificateList::CertificateList(const char *fileName)
+CertificateList::CertificateList() : mStatus(NoList)
+{
+}
+
+list_status_t CertificateList::readList(const char *fileName)
 {
     char *data = NULL;
     size_t size = 0;
@@ -12,7 +16,7 @@
     mStatus = read_and_verify_list(fileName, &data, &size);
 
     if (!isValid()) {
-        return;
+        return mStatus;
     }
 
     // Take the data into the Qt Universe where memory is plentiful
@@ -27,7 +31,7 @@
             if (curLine.right(1) != PARSER_VERSION) {
                 qDebug() << "Invalid Format Version";
                 mStatus = IncompatibleVersion;
-                return;
+                return mStatus;
             }
         } else if (curLine.startsWith("D:")) {
             bool ok = false;
@@ -38,7 +42,7 @@
             if (!ok) {
                 qDebug() << "Invalid Date";
                 mStatus = InvalidFormat;
-                return;
+                return mStatus;
             }
 
             mDate = QDateTime::fromMSecsSinceEpoch(timestamp * 1000);
@@ -55,4 +59,10 @@
             qDebug () << "Don't know how to handle: " << curLine;
         }
     }
+    return mStatus;
 }
+
+CertificateList::CertificateList(const char *fileName) : mStatus(NoList)
+{
+    readList(fileName);
+}

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