diff options
author | Einar Johan Trøan Sømåen | 2015-04-04 18:40:20 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2015-04-09 20:02:16 +0200 |
commit | 7052823969df356b9567358d52e8012bb5459c86 (patch) | |
tree | 9e4d002a7cba2cdd4999ef611d419a9079373f99 /devtools/create_project | |
parent | 7e7347f877e7dd3a08c8d36b397badc6b81d9ea3 (diff) | |
download | scummvm-rg350-7052823969df356b9567358d52e8012bb5459c86.tar.gz scummvm-rg350-7052823969df356b9567358d52e8012bb5459c86.tar.bz2 scummvm-rg350-7052823969df356b9567358d52e8012bb5459c86.zip |
CREATE_PROJECT: Make sure that children of PBXGroups are always listed as a list with "," after every item, even when there's only one child.
This modifies the combination of SettingsAsList and SettingsSingleItem so that "," is used after the item, instead of ";", but only when they are used together.
Diffstat (limited to 'devtools/create_project')
-rw-r--r-- | devtools/create_project/xcode.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index c1192d3a58..4e651072b1 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -231,7 +231,11 @@ void XCodeProvider::writeFileListToProject(const FileNode &dir, std::ofstream &p if (!node->children.empty()) writeFileListToProject(*node, projectFile, indentation + 1, duplicate, objPrefix + node->name + '_', filePrefix + node->name + '/'); } - + if (order == 1) { + // Force children to use () even when there is only 1 child. + // Also this enforces the use of "," after the single item, instead of ; (see writeProperty) + children.flags |= SettingsSingleItem; + } group->properties["children"] = children; _groups.add(group); @@ -877,7 +881,9 @@ std::string XCodeProvider::writeProperty(const std::string &variable, Property & output += writeSetting((*setting).first, (*setting).second); - if ((prop.flags & SettingsAsList) && prop.settings.size() > 1) { + // The combination of SettingsAsList, and SettingsSingleItem should use "," and not ";" (i.e children + // in PBXGroup, so we special case that case here. + if ((prop.flags & SettingsAsList) && (prop.settings.size() > 1 || (prop.flags & SettingsSingleItem))) { output += (prop.settings.size() > 0) ? ",\n" : "\n"; } else { output += ";"; |