summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-06-07 21:09:13 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-06-07 21:09:13 +0000
commit594d734143a8a9df49dcec3f80a8588fa3fdb836 (patch)
tree7b05baf051f68fea47e1c50103835dcf163234e0
parent0e44ce9bedbea1244ef971b48f38a9c48eecf0f5 (diff)
downloadrockbox-594d734143a8a9df49dcec3f80a8588fa3fdb836.tar.gz
rockbox-594d734143a8a9df49dcec3f80a8588fa3fdb836.tar.bz2
rockbox-594d734143a8a9df49dcec3f80a8588fa3fdb836.zip
Theme Editor: Added a clear erros function to the parser
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26673 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--utils/themeeditor/editorwindow.cpp8
-rw-r--r--utils/themeeditor/skin_debug.c6
-rw-r--r--utils/themeeditor/skin_debug.h1
-rw-r--r--utils/themeeditor/skin_parser.c2
-rw-r--r--utils/themeeditor/skindocument.cpp1
5 files changed, 14 insertions, 4 deletions
diff --git a/utils/themeeditor/editorwindow.cpp b/utils/themeeditor/editorwindow.cpp
index ca5f8bfa73..23724ee1ad 100644
--- a/utils/themeeditor/editorwindow.cpp
+++ b/utils/themeeditor/editorwindow.cpp
@@ -166,10 +166,10 @@ void EditorWindow::shiftTab(int index)
else
{
/* Syncing the tree view and the status bar */
- ui->parseTree->setModel(dynamic_cast<SkinDocument*>
- (ui->editorTabs->currentWidget())->getModel());
- parseStatus->setText(dynamic_cast<SkinDocument*>
- (ui->editorTabs->currentWidget())->getStatus());
+ SkinDocument* doc = dynamic_cast<SkinDocument*>
+ (ui->editorTabs->currentWidget());
+ ui->parseTree->setModel(doc->getModel());
+ parseStatus->setText(doc->getStatus());
ui->actionSave_Document->setEnabled(true);
ui->actionSave_Document_As->setEnabled(true);
diff --git a/utils/themeeditor/skin_debug.c b/utils/themeeditor/skin_debug.c
index 4a2ef32206..eb132a3320 100644
--- a/utils/themeeditor/skin_debug.c
+++ b/utils/themeeditor/skin_debug.c
@@ -93,6 +93,12 @@ char* skin_error_message()
return error_message;
}
+void skin_clear_errors()
+{
+ error_line = 0;
+ error_message = NULL;
+}
+
void skin_debug_tree(struct skin_element* root)
{
int i;
diff --git a/utils/themeeditor/skin_debug.h b/utils/themeeditor/skin_debug.h
index 24c66e6671..a550dc4c7b 100644
--- a/utils/themeeditor/skin_debug.h
+++ b/utils/themeeditor/skin_debug.h
@@ -34,6 +34,7 @@ extern "C"
void skin_error(enum skin_errorcode error);
int skin_error_line();
char* skin_error_message();
+void skin_clear_errors();
void skin_debug_tree(struct skin_element* root);
/* Auxiliary debug functions */
diff --git a/utils/themeeditor/skin_parser.c b/utils/themeeditor/skin_parser.c
index c046dc66ad..58acafb56a 100644
--- a/utils/themeeditor/skin_parser.c
+++ b/utils/themeeditor/skin_parser.c
@@ -64,6 +64,8 @@ struct skin_element* skin_parse(const char* document)
skin_line = 1;
+ skin_clear_errors();
+
while(*cursor != '\0')
{
diff --git a/utils/themeeditor/skindocument.cpp b/utils/themeeditor/skindocument.cpp
index c7b69688f6..3ce70ad5be 100644
--- a/utils/themeeditor/skindocument.cpp
+++ b/utils/themeeditor/skindocument.cpp
@@ -35,6 +35,7 @@ SkinDocument::SkinDocument(QLabel* statusLabel, QWidget *parent) :
title = "Untitled";
fileName = "";
saved = "";
+ parseStatus = tr("Empty Document");
}
SkinDocument::SkinDocument(QLabel* statusLabel, QString file, QWidget *parent):