| 65 | } |
| 66 | |
| 67 | bool tryValues(QXmlStreamReader &reader, ComicInfo &info) |
| 68 | { |
| 69 | std::map<QString, QVariant &> stringValues = { |
| 70 | { "Number", info.number }, |
| 71 | { "Title", info.title }, |
| 72 | { "Volume", info.volume }, |
| 73 | { "StoryArc", info.storyArc }, |
| 74 | { "Genre", info.genere }, |
| 75 | { "Publisher", info.publisher }, |
| 76 | { "Format", info.format }, |
| 77 | { "AgeRating", info.ageRating }, |
| 78 | { "Summary", info.synopsis }, |
| 79 | { "Notes", info.notes }, |
| 80 | { "Editor", info.editor }, |
| 81 | { "Imprint", info.imprint }, |
| 82 | { "Series", info.series }, |
| 83 | { "AlternateSeries", info.alternateSeries }, |
| 84 | { "AlternateNumber", info.alternateNumber }, |
| 85 | { "LanguageISO", info.languageISO }, |
| 86 | { "SeriesGroup", info.seriesGroup }, |
| 87 | { "MainCharacterOrTeam", info.mainCharacterOrTeam }, |
| 88 | { "Review", info.review }, |
| 89 | }; |
| 90 | |
| 91 | std::map<QString, QVariant &> forcedNumbers = { |
| 92 | { "Count", info.count }, |
| 93 | { "AlternateCount", info.alternateCount }, |
| 94 | { "Day", info.day }, |
| 95 | { "Month", info.month }, |
| 96 | { "Year", info.year }, |
| 97 | }; |
| 98 | |
| 99 | std::map<QString, QVariant &> multiValuedStrings = { |
| 100 | { "Writer", info.writer }, |
| 101 | { "Penciller", info.penciller }, |
| 102 | { "Inker", info.inker }, |
| 103 | { "Colorist", info.colorist }, |
| 104 | { "Letterer", info.letterer }, |
| 105 | { "CoverArtist", info.coverArtist }, |
| 106 | { "Characters", info.characters }, |
| 107 | { "Teams", info.teams }, |
| 108 | { "Locations", info.locations } |
| 109 | }; |
| 110 | |
| 111 | for (auto &pair : stringValues) { |
| 112 | if (parseField(reader, pair.first, pair.second)) { |
| 113 | return true; |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | for (auto &pair : forcedNumbers) { |
| 118 | if (parseFieldNumber(reader, pair.first, pair.second)) { |
| 119 | return true; |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | for (auto &pair : multiValuedStrings) { |
| 124 | if (parseField(reader, pair.first, pair.second, true)) { |
no test coverage detected