diff changeset.cpp @ 106:729438d70af8

* Retrieve and store current branch and heads; some refactoring
author Chris Cannam
date Thu, 25 Nov 2010 17:54:35 +0000
parents f583e44d9d31
children 8ae3b44c0073
line wrap: on
line diff
--- a/changeset.cpp	Thu Nov 25 17:21:32 2010 +0000
+++ b/changeset.cpp	Thu Nov 25 17:54:35 2010 +0000
@@ -16,3 +16,21 @@
 */
 
 #include "changeset.h"
+
+#include <QVariant>
+
+Changeset::Changeset(const LogEntry &e)
+{
+    foreach (QString key, e.keys()) {
+        if (key == "parents") {
+            QStringList parents = e.value(key).split
+                (" ", QString::SkipEmptyParts);
+            setParents(parents);
+        } else if (key == "timestamp") {
+            setTimestamp(e.value(key).split(" ")[0].toULongLong());
+        } else {
+            setProperty(key.toLocal8Bit().data(), e.value(key));
+        }
+    }
+}
+