summaryrefslogtreecommitdiffstats
path: root/utils/themeeditor/editorwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/themeeditor/editorwindow.cpp')
-rw-r--r--utils/themeeditor/editorwindow.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/utils/themeeditor/editorwindow.cpp b/utils/themeeditor/editorwindow.cpp
index 42ca22cec2..feaac6fe47 100644
--- a/utils/themeeditor/editorwindow.cpp
+++ b/utils/themeeditor/editorwindow.cpp
@@ -30,7 +30,9 @@ EditorWindow::EditorWindow(QWidget *parent) :
{
ui->setupUi(this);
- tree = 0;
+ /* Establishing the parse tree */
+ tree = new ParseTreeModel(ui->code->document()->toPlainText().toAscii());
+ ui->parseTree->setModel(tree);
/* Connecting the buttons */
QObject::connect(ui->code, SIGNAL(cursorPositionChanged()),
@@ -41,11 +43,7 @@ EditorWindow::EditorWindow(QWidget *parent) :
void EditorWindow::updateTree()
{
- if(tree)
- delete tree;
-
- tree = new ParseTreeModel(ui->code->document()->toPlainText().toAscii());
- ui->parseTree->setModel(tree);
+ tree->changeTree(ui->code->document()->toPlainText().toAscii());
ui->parseTree->expandAll();
}