summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Habacker <[email protected]>2015-06-21 15:59:22 +0200
committerRalf Habacker <[email protected]>2015-06-21 22:32:41 +0200
commit2641783faaaddecca5ef8864ded10c859abde1a9 (patch)
treeb18704d2cbcfa70274a1b09f42d72a9f8d268f5d
parentb1e7d3ef0983c2cef7e3a4c0ec27b6bf3ba63b74 (diff)
Add methods loadFromXMI() and saveToXMI() to class CodeImportState.
-rw-r--r--umbrello/optionstate.cpp26
-rw-r--r--umbrello/optionstate.h3
2 files changed, 29 insertions, 0 deletions
diff --git a/umbrello/optionstate.cpp b/umbrello/optionstate.cpp
index 1650889..1e53e11 100644
--- a/umbrello/optionstate.cpp
+++ b/umbrello/optionstate.cpp
@@ -115,6 +115,32 @@ namespace Settings {
return true;
}
+ /**
+ * Save instance into a QDomElement.
+ * @param element A QDomElement representing xml element data.
+ */
+ void CodeImportState::saveToXMI(QDomElement &element)
+ {
+ element.setAttribute(QLatin1String("createartifacts"), createArtifacts);
+ element.setAttribute(QLatin1String("resolvedependencies"), resolveDependencies);
+ }
+
+ /**
+ * Load instance from a QDomElement.
+ * @param element A QDomElement representing xml element data.
+ * @return true on success
+ * @return false on error
+ */
+ bool CodeImportState::loadFromXMI(QDomElement &element)
+ {
+ QString temp = element.attribute(QLatin1String("createartifacts"), QLatin1String("0"));
+ createArtifacts = (bool)temp.toInt();
+ temp = element.attribute(QLatin1String("resolvedependencies"), QLatin1String("0"));
+ resolveDependencies = (bool)temp.toInt();
+
+ return true;
+ }
+
OptionState& optionState()
{
return OptionState::instance();
diff --git a/umbrello/optionstate.h b/umbrello/optionstate.h
index f3d09c5..2559ff6 100644
--- a/umbrello/optionstate.h
+++ b/umbrello/optionstate.h
@@ -182,6 +182,9 @@ public:
{
}
+ void saveToXMI(QDomElement& element);
+ bool loadFromXMI(QDomElement& element);
+
bool createArtifacts;
bool resolveDependencies;
};