summaryrefslogtreecommitdiff
path: root/utils/themeeditor/models/parsetreenode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/themeeditor/models/parsetreenode.cpp')
-rw-r--r--utils/themeeditor/models/parsetreenode.cpp35
1 files changed, 21 insertions, 14 deletions
diff --git a/utils/themeeditor/models/parsetreenode.cpp b/utils/themeeditor/models/parsetreenode.cpp
index 8d1fcc7d1a..1dedd4a689 100644
--- a/utils/themeeditor/models/parsetreenode.cpp
+++ b/utils/themeeditor/models/parsetreenode.cpp
@@ -36,19 +36,21 @@ int ParseTreeNode::openConditionals = 0;
36bool ParseTreeNode::breakFlag = false; 36bool ParseTreeNode::breakFlag = false;
37 37
38/* Root element constructor */ 38/* Root element constructor */
39ParseTreeNode::ParseTreeNode(struct skin_element* data) 39ParseTreeNode::ParseTreeNode(struct skin_element* data, ParseTreeModel* model)
40 : parent(0), element(0), param(0), children() 40 : parent(0), element(0), param(0), children(), model(model)
41{ 41{
42 while(data) 42 while(data)
43 { 43 {
44 children.append(new ParseTreeNode(data, this)); 44 children.append(new ParseTreeNode(data, this, model));
45 data = data->next; 45 data = data->next;
46 } 46 }
47} 47}
48 48
49/* Normal element constructor */ 49/* Normal element constructor */
50ParseTreeNode::ParseTreeNode(struct skin_element* data, ParseTreeNode* parent) 50ParseTreeNode::ParseTreeNode(struct skin_element* data, ParseTreeNode* parent,
51 : parent(parent), element(data), param(0), children() 51 ParseTreeModel* model)
52 : parent(parent), element(data), param(0),
53 children(), model(model)
52{ 54{
53 switch(element->type) 55 switch(element->type)
54 { 56 {
@@ -58,29 +60,30 @@ ParseTreeNode::ParseTreeNode(struct skin_element* data, ParseTreeNode* parent)
58 { 60 {
59 if(element->params[i].type == skin_tag_parameter::CODE) 61 if(element->params[i].type == skin_tag_parameter::CODE)
60 children.append(new ParseTreeNode(element->params[i].data.code, 62 children.append(new ParseTreeNode(element->params[i].data.code,
61 this)); 63 this, model));
62 else 64 else
63 children.append(new ParseTreeNode(&element->params[i], this)); 65 children.append(new ParseTreeNode(&element->params[i], this,
66 model));
64 } 67 }
65 break; 68 break;
66 69
67 case CONDITIONAL: 70 case CONDITIONAL:
68 for(int i = 0; i < element->params_count; i++) 71 for(int i = 0; i < element->params_count; i++)
69 children.append(new ParseTreeNode(&data->params[i], this)); 72 children.append(new ParseTreeNode(&data->params[i], this, model));
70 for(int i = 0; i < element->children_count; i++) 73 for(int i = 0; i < element->children_count; i++)
71 children.append(new ParseTreeNode(data->children[i], this)); 74 children.append(new ParseTreeNode(data->children[i], this, model));
72 break; 75 break;
73 76
74 case LINE_ALTERNATOR: 77 case LINE_ALTERNATOR:
75 for(int i = 0; i < element->children_count; i++) 78 for(int i = 0; i < element->children_count; i++)
76 { 79 {
77 children.append(new ParseTreeNode(data->children[i], this)); 80 children.append(new ParseTreeNode(data->children[i], this, model));
78 } 81 }
79 break; 82 break;
80 83
81case VIEWPORT: 84case VIEWPORT:
82 for(int i = 0; i < element->params_count; i++) 85 for(int i = 0; i < element->params_count; i++)
83 children.append(new ParseTreeNode(&data->params[i], this)); 86 children.append(new ParseTreeNode(&data->params[i], this, model));
84 /* Deliberate fall-through here */ 87 /* Deliberate fall-through here */
85 88
86 case LINE: 89 case LINE:
@@ -89,7 +92,7 @@ case VIEWPORT:
89 for(struct skin_element* current = data->children[i]; current; 92 for(struct skin_element* current = data->children[i]; current;
90 current = current->next) 93 current = current->next)
91 { 94 {
92 children.append(new ParseTreeNode(current, this)); 95 children.append(new ParseTreeNode(current, this, model));
93 } 96 }
94 } 97 }
95 break; 98 break;
@@ -100,8 +103,10 @@ case VIEWPORT:
100} 103}
101 104
102/* Parameter constructor */ 105/* Parameter constructor */
103ParseTreeNode::ParseTreeNode(skin_tag_parameter *data, ParseTreeNode *parent) 106ParseTreeNode::ParseTreeNode(skin_tag_parameter *data, ParseTreeNode *parent,
104 : parent(parent), element(0), param(data), children() 107 ParseTreeModel *model)
108 : parent(parent), element(0), param(data),
109 children(), model(model)
105{ 110{
106 111
107} 112}
@@ -1085,5 +1090,7 @@ void ParseTreeNode::modParam(QVariant value, int index)
1085 param->data.number = value.toInt(); 1090 param->data.number = value.toInt();
1086 } 1091 }
1087 1092
1093 model->paramChanged(this);
1094
1088 } 1095 }
1089} 1096}