MCPcopy Create free account
hub / github.com/IENT/YUView / saveAndGetIndex

Method saveAndGetIndex

YUViewLib/src/statistics/CustomColorMapStorage.cpp:145–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145size_t CustomColorMapStorage::saveAndGetIndex(const CustomColorMap &customColormap)
146{
147 for (size_t i = 0; i < this->customColorMaps.size(); ++i)
148 {
149 if (this->customColorMaps.at(i).name == customColormap.name)
150 {
151 this->customColorMaps[i] = customColormap;
152 storeToSettings(this->customColorMaps);
153 return i;
154 }
155 }
156
157 this->customColorMaps.push_back(customColormap);
158 storeToSettings(this->customColorMaps);
159 return this->customColorMaps.size() - 1;
160}
161
162void CustomColorMapStorage::remove(const QString &name)
163{

Callers 1

Calls 3

storeToSettingsFunction · 0.85
sizeMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected