1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

DocData: Drop unused brief description for properties

This commit is contained in:
Rémi Verschelde
2017-09-12 23:06:26 +02:00
parent 4f929a0fdf
commit 4e392517da
3 changed files with 17 additions and 36 deletions

View File

@@ -52,7 +52,7 @@ void DocData::merge_from(const DocData &p_data) {
c.description = cf.description; c.description = cf.description;
c.brief_description = cf.brief_description; c.brief_description = cf.brief_description;
c.tutorials = cf.tutorials; c.tutorials = cf.tutorials;
c.demos =cf.demos; c.demos = cf.demos;
for (int i = 0; i < c.methods.size(); i++) { for (int i = 0; i < c.methods.size(); i++) {
@@ -681,7 +681,7 @@ static Error _parse_methods(Ref<XMLParser> &parser, Vector<DocData::MethodDoc> &
Error DocData::load_classes(const String &p_dir) { Error DocData::load_classes(const String &p_dir) {
Error err; Error err;
DirAccessRef da = DirAccess::open(p_dir,&err); DirAccessRef da = DirAccess::open(p_dir, &err);
if (!da) { if (!da) {
return err; return err;
} }
@@ -689,8 +689,8 @@ Error DocData::load_classes(const String &p_dir) {
da->list_dir_begin(); da->list_dir_begin();
String path; String path;
bool isdir; bool isdir;
path=da->get_next(&isdir); path = da->get_next(&isdir);
while(path!=String()) { while (path != String()) {
if (!isdir && path.ends_with("xml")) { if (!isdir && path.ends_with("xml")) {
Ref<XMLParser> parser = memnew(XMLParser); Ref<XMLParser> parser = memnew(XMLParser);
Error err = parser->open(p_dir.plus_file(path)); Error err = parser->open(p_dir.plus_file(path));
@@ -699,7 +699,7 @@ Error DocData::load_classes(const String &p_dir) {
_load(parser); _load(parser);
} }
path=da->get_next(&isdir); path = da->get_next(&isdir);
} }
da->list_dir_end(); da->list_dir_end();
@@ -709,7 +709,7 @@ Error DocData::load_classes(const String &p_dir) {
Error DocData::erase_classes(const String &p_dir) { Error DocData::erase_classes(const String &p_dir) {
Error err; Error err;
DirAccessRef da = DirAccess::open(p_dir,&err); DirAccessRef da = DirAccess::open(p_dir, &err);
if (!da) { if (!da) {
return err; return err;
} }
@@ -719,16 +719,16 @@ Error DocData::erase_classes(const String &p_dir) {
da->list_dir_begin(); da->list_dir_begin();
String path; String path;
bool isdir; bool isdir;
path=da->get_next(&isdir); path = da->get_next(&isdir);
while(path!=String()) { while (path != String()) {
if (!isdir && path.ends_with("xml")) { if (!isdir && path.ends_with("xml")) {
to_erase.push_back(path); to_erase.push_back(path);
} }
path=da->get_next(&isdir); path = da->get_next(&isdir);
} }
da->list_dir_end(); da->list_dir_end();
while(to_erase.size()) { while (to_erase.size()) {
da->remove(to_erase.front()->get()); da->remove(to_erase.front()->get());
to_erase.pop_front(); to_erase.pop_front();
} }
@@ -815,8 +815,6 @@ Error DocData::_load(Ref<XMLParser> parser) {
prop.setter = parser->get_attribute_value("setter"); prop.setter = parser->get_attribute_value("setter");
if (parser->has_attribute("getter")) if (parser->has_attribute("getter"))
prop.getter = parser->get_attribute_value("getter"); prop.getter = parser->get_attribute_value("getter");
if (parser->has_attribute("brief"))
prop.brief_description = parser->get_attribute_value("brief").xml_unescape();
if (parser->has_attribute("enum")) if (parser->has_attribute("enum"))
prop.enumeration = parser->get_attribute_value("enum"); prop.enumeration = parser->get_attribute_value("enum");
parser->read(); parser->read();
@@ -914,24 +912,21 @@ static void _write_string(FileAccess *f, int p_tablevel, const String &p_string)
f->store_string(tab + p_string + "\n"); f->store_string(tab + p_string + "\n");
} }
Error DocData::save_classes(const String &p_default_path, const Map<String,String>& p_class_path) { Error DocData::save_classes(const String &p_default_path, const Map<String, String> &p_class_path) {
for (Map<String, ClassDoc>::Element *E = class_list.front(); E; E = E->next()) { for (Map<String, ClassDoc>::Element *E = class_list.front(); E; E = E->next()) {
ClassDoc &c = E->get(); ClassDoc &c = E->get();
String save_path; String save_path;
if (p_class_path.has(c.name)) { if (p_class_path.has(c.name)) {
save_path=p_class_path[c.name]; save_path = p_class_path[c.name];
} else { } else {
save_path=p_default_path; save_path = p_default_path;
} }
Error err; Error err;
String save_file = save_path.plus_file(c.name+".xml"); String save_file = save_path.plus_file(c.name + ".xml");
FileAccessRef f = FileAccess::open(save_file, FileAccess::WRITE, &err); FileAccessRef f = FileAccess::open(save_file, FileAccess::WRITE, &err);
if (err) { if (err) {
ERR_EXPLAIN("Can't write doc file: " + save_file); ERR_EXPLAIN("Can't write doc file: " + save_file);
@@ -949,7 +944,7 @@ Error DocData::save_classes(const String &p_default_path, const Map<String,Strin
if (c.category == "") if (c.category == "")
category = "Core"; category = "Core";
header += " category=\"" + category + "\""; header += " category=\"" + category + "\"";
header+=" version=\"" + String(VERSION_MKSTRING) + "\""; header += " version=\"" + String(VERSION_MKSTRING) + "\"";
header += ">"; header += ">";
_write_string(f, 0, header); _write_string(f, 0, header);
_write_string(f, 1, "<brief_description>"); _write_string(f, 1, "<brief_description>");
@@ -1031,7 +1026,7 @@ Error DocData::save_classes(const String &p_default_path, const Map<String,Strin
enum_text = " enum=\"" + c.properties[i].enumeration + "\""; enum_text = " enum=\"" + c.properties[i].enumeration + "\"";
} }
PropertyDoc &p = c.properties[i]; PropertyDoc &p = c.properties[i];
_write_string(f, 2, "<member name=\"" + p.name + "\" type=\"" + p.type + "\" setter=\"" + p.setter + "\" getter=\"" + p.getter + "\" brief=\"" + p.brief_description.xml_escape(true) + "\"" + enum_text + ">"); _write_string(f, 2, "<member name=\"" + p.name + "\" type=\"" + p.type + "\" setter=\"" + p.setter + "\" getter=\"" + p.getter + "\"" + enum_text + ">");
if (p.description != "") if (p.description != "")
_write_string(f, 3, p.description.xml_escape()); _write_string(f, 3, p.description.xml_escape());
_write_string(f, 2, "</member>"); _write_string(f, 2, "</member>");
@@ -1100,7 +1095,6 @@ Error DocData::save_classes(const String &p_default_path, const Map<String,Strin
_write_string(f, 0, "</class>"); _write_string(f, 0, "</class>");
} }
return OK; return OK;
} }

View File

@@ -70,7 +70,6 @@ public:
String name; String name;
String type; String type;
String enumeration; String enumeration;
String brief_description;
String description; String description;
String setter, getter; String setter, getter;
bool operator<(const PropertyDoc &p_prop) const { bool operator<(const PropertyDoc &p_prop) const {
@@ -105,7 +104,7 @@ public:
void generate(bool p_basic_types = false); void generate(bool p_basic_types = false);
Error load_classes(const String &p_dir); Error load_classes(const String &p_dir);
static Error erase_classes(const String &p_dir); static Error erase_classes(const String &p_dir);
Error save_classes(const String &p_default_path,const Map<String,String>& p_class_path); Error save_classes(const String &p_default_path, const Map<String, String> &p_class_path);
Error load_compressed(const uint8_t *p_data, int p_compressed_size, int p_uncompressed_size); Error load_compressed(const uint8_t *p_data, int p_compressed_size, int p_uncompressed_size);
}; };

View File

@@ -800,18 +800,6 @@ Error EditorHelp::_goto_desc(const String &p_class, int p_vscr) {
if (describe) { if (describe) {
class_desc->pop(); class_desc->pop();
}
if (cd.properties[i].brief_description != "") {
class_desc->push_font(doc_font);
class_desc->add_text(" ");
class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/comment_color"));
_add_text(cd.properties[i].description);
class_desc->pop();
class_desc->pop();
}
if (describe) {
property_descr = true; property_descr = true;
} }