gui2/twml_error: Ignore empty _info.cfg [info] title= attribute

This allows the synthetic add-on name to be used in the absence of an
[info] title= attribute, e.g. for add-ons downloaded with older versions
of Wesnoth or wesnoth_addon_manager.
This commit is contained in:
Ignacio R. Morelle 2014-06-13 02:29:51 -04:00
parent 7df5aab23e
commit c9c33660dd
2 changed files with 4 additions and 1 deletions

View file

@ -65,6 +65,9 @@ Version 1.13.0-dev:
* Added a button to copy the currently displayed content from the :inspect
dialog to clipboard.
* Added a button to copy the in-game Chat Log dialog contents to clipboard.
* Fixed the WML load error dialog not displaying an add-on name instead of
falling back to its directory name if the add-on contains an outdated
_info.cfg file lacking an [info]title= value.
* WML engine:
* Added customizable recall costs for unit types and individual units,
using the new recall_cost attribute in [unit_type] and [unit].

View file

@ -110,7 +110,7 @@ std::string format_file_list(const std::vector<std::string>& files_original)
const config& info_cfg = cfg.child("info");
if(info_cfg) {
if(info_cfg && !info_cfg["title"].empty()) {
file = info_cfg["title"].str();
continue;
}