WIP: further refactoring.

This commit is contained in:
Matthias Koefferlein 2020-02-10 00:38:48 +01:00
parent 45b6a72bee
commit 9cb81ce807
3 changed files with 14 additions and 9 deletions

View File

@ -176,9 +176,9 @@ template <unsigned int NUM>
gsi::Methods cm_method_decl () gsi::Methods cm_method_decl ()
{ {
tl_assert (NUM < sizeof (cm_symbols) / sizeof (cm_symbols [0])); tl_assert (NUM < sizeof (cm_symbols) / sizeof (cm_symbols [0]));
return gsi::method (std::string ("#") + cm_symbols [NUM], &call_cm_method<NUM>, return gsi::method_ext (std::string ("#") + cm_symbols [NUM], &call_cm_method<NUM>,
std::string ("@brief '") + cm_symbols[NUM] + "' action.\n" std::string ("@brief '") + cm_symbols[NUM] + "' action.\n"
"This method has been added in version 0.25 and is deprecated in version 0.27.\n" "This method is deprecated in version 0.27.\n"
"Use \"call_menu('" + std::string (cm_symbols[NUM]) + "')\" instead."); "Use \"call_menu('" + std::string (cm_symbols[NUM]) + "')\" instead.");
} }

View File

@ -825,7 +825,12 @@ method_arguments (const gsi::MethodBase *method, const gsi::ClassBase *cls_obj,
if (! a->spec ()->init_doc ().empty ()) { if (! a->spec ()->init_doc ().empty ()) {
r += replace_references (escape_xml (a->spec ()->init_doc ()), cls_obj); r += replace_references (escape_xml (a->spec ()->init_doc ()), cls_obj);
} else { } else {
r += escape_xml (a->spec ()->default_value ().to_string ()); try {
r += escape_xml (a->spec ()->default_value ().to_string ());
} catch (tl::Exception &ex) {
tl::error << cls_obj->name () << "#" << method->begin_synonyms ()->name << ": " << ex.msg ();
r += "?";
}
} }
} }
} else if (n < int (doc.args.size ())) { } else if (n < int (doc.args.size ())) {
@ -1339,11 +1344,11 @@ GSIHelpProvider::produce_class_doc (const std::string &cls) const
os << "<p>" << tl::to_string (QObject::tr ("Use of this method is deprecated")) << "</p>" << std::endl; os << "<p>" << tl::to_string (QObject::tr ("Use of this method is deprecated")) << "</p>" << std::endl;
} }
} else { }
std::string dh = method_doc.doc;
if (! tl::Extractor (dh.c_str ()).at_end ()) { std::string dh = method_doc.doc;
os << "<p>" << replace_references (method_doc.doc_html (), cls_obj) << "</p>" << std::endl; if (! tl::Extractor (dh.c_str ()).at_end ()) {
} os << "<p>" << replace_references (method_doc.doc_html (), cls_obj) << "</p>" << std::endl;
} }
if (! pydoc.empty ()) { if (! pydoc.empty ()) {

View File

@ -413,7 +413,7 @@ static lay::LayoutView *new_view (QWidget *parent, bool editable, db::Manager *m
} }
Class<lay::LayoutView> decl_LayoutView (QT_EXTERNAL_BASE (QWidget) "lay", "LayoutView", Class<lay::LayoutView> decl_LayoutView (QT_EXTERNAL_BASE (QWidget) "lay", "LayoutView",
gsi::constructor ("new", &new_view, gsi::arg ("parent", (QWidget *) 0), gsi::arg ("editable", false), gsi::arg ("manager", (db::Manager *) 0), gsi::arg ("options", (unsigned int) 0), gsi::constructor ("new", &new_view, gsi::arg ("parent", (QWidget *) 0, "nil"), gsi::arg ("editable", false), gsi::arg ("manager", (db::Manager *) 0, "nil"), gsi::arg ("options", (unsigned int) 0),
"@brief Creates a standalone view\n" "@brief Creates a standalone view\n"
"\n" "\n"
"This constructor is for special purposes only. To create a view in the context of a main window, " "This constructor is for special purposes only. To create a view in the context of a main window, "