connect the type to some other information We could also use paired arrays, but this way, its less likely to have mismatches if a new type is added
| 20 | /// connect the type to some other information |
| 21 | /// We could also use paired arrays, but this way, its less likely to have mismatches if a new type is added |
| 22 | struct TypeNameBinding |
| 23 | { |
| 24 | FileTypes::Type type; |
| 25 | String name; |
| 26 | String description; |
| 27 | TypeNameBinding(FileTypes::Type ptype, String pname, String pdescription) |
| 28 | : type(ptype), name(std::move(pname)), description(std::move(pdescription)) |
| 29 | { |
| 30 | // Check that there are no double-spaces in the description, since Qt will replace " " with " " in filters supplied to QFileDialog::getSaveFileName. |
| 31 | // And if you later ask for the selected filter, you will get a different string back. |
| 32 | assert(description.find(" ") == std::string::npos); |
| 33 | } |
| 34 | }; |
| 35 | |
| 36 | /// Maps the FileType::Type to the preferred extension. |
| 37 | static const std::array<TypeNameBinding, FileTypes::SIZE_OF_TYPE> type_with_annotation__ = |