summaryrefslogtreecommitdiff
path: root/project2/variables.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'project2/variables.cpp')
-rw-r--r--project2/variables.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/project2/variables.cpp b/project2/variables.cpp
index 5514638..2e08b1b 100644
--- a/project2/variables.cpp
+++ b/project2/variables.cpp
@@ -135,7 +135,9 @@ class VariableImplDyn : public VariableImpl {
cacheValid(false)
{
try {
- defaultValue = Variable(e, "default");
+ if (e) {
+ defaultValue = Variable(e, "default");
+ }
}
catch (NoVariableDefinition) {
// That's cool... no default
@@ -352,6 +354,11 @@ class VariableConfig : public VariableImplDyn {
const Glib::ustring name;
};
+Variable::Variable(VariableType def) :
+ var(new VariableFixed(def))
+{
+}
+
Variable::Variable(const xmlpp::Element * e, const Glib::ustring & n, bool required, VariableType def)
{
xmlpp::Attribute * a = e->get_attribute(n);