MCPcopy Create free account
hub / github.com/OpenOrienteering/mapper / processTranslation

Function processTranslation

test/symbol_set_t.cpp:99–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99void processTranslation(const Map& map, TranslationEntries& translation_entries)
100{
101 auto const id = map.symbolSetId();
102
103 auto num_colors = map.getNumColors();
104 for (int i = 0; i < num_colors; ++i)
105 {
106 auto* color = map.getColor(i);
107 auto const& source = color->getName();
108 auto comment = QString{QLatin1String("Color ") + QString::number(color->getPriority())};
109 addSource(translation_entries, id, source, comment);
110 }
111
112 auto num_symbols = map.getNumSymbols();
113 for (int i = 0; i < num_symbols; ++i)
114 {
115 auto symbol = map.getSymbol(i);
116 auto source = symbol->getName();
117 auto comment = QString{QLatin1String("Name of symbol ") + symbol->getNumberAsString()};
118 addSource(translation_entries, id, source, comment);
119
120 source = symbol->getDescription();
121 comment = QString{QLatin1String("Description of symbol ") + symbol->getNumberAsString()};
122 if (source.isEmpty())
123 qInfo("%s: empty", qPrintable(comment));
124 else
125 addSource(translation_entries, id, source, comment);
126 }
127}
128
129
130/// \todo Review unused function

Callers 1

processSymbolSetMethod · 0.85

Calls 10

QLatin1StringClass · 0.85
addSourceFunction · 0.85
symbolSetIdMethod · 0.80
getNumColorsMethod · 0.80
getPriorityMethod · 0.80
getNumSymbolsMethod · 0.80
getNumberAsStringMethod · 0.80
getColorMethod · 0.45
getSymbolMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected