| 107 | } |
| 108 | |
| 109 | void FileChooser::assembleMapExportFileTypes() |
| 110 | { |
| 111 | FileTypePatterns patterns = GlobalFiletypes().getPatternsForType(_fileType); |
| 112 | |
| 113 | for (const auto& pattern : patterns) |
| 114 | { |
| 115 | auto formats = GlobalMapFormatManager().getMapFormatList(pattern.extension); |
| 116 | |
| 117 | // Pre-select take the default map format for this game type |
| 118 | auto defaultFormat = GlobalMapFormatManager().getMapFormatForGameType( |
| 119 | GlobalGameManager().currentGame()->getKeyValue("type"), pattern.extension |
| 120 | ); |
| 121 | |
| 122 | for (const map::MapFormatPtr& format : formats) |
| 123 | { |
| 124 | FileFilter filter; |
| 125 | |
| 126 | filter.caption = format->getMapFormatName() + " " + pattern.name + " (" + pattern.pattern + ")"; |
| 127 | filter.filter = pattern.pattern; |
| 128 | filter.extension = pattern.extension; |
| 129 | filter.mapFormatName = format->getMapFormatName(); |
| 130 | |
| 131 | _fileFilters.push_back(filter); |
| 132 | |
| 133 | if (format == defaultFormat) |
| 134 | { |
| 135 | filter.isDefaultFilter = true; |
| 136 | } |
| 137 | } |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | void FileChooser::assembleFileTypes() |
| 142 | { |
nothing calls this directly
no test coverage detected