MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / findFormat

Method findFormat

Engine/ProjectPrivate.cpp:265–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263} // restoreFromSerialization
264
265bool
266ProjectPrivate::findFormat(int index,
267 Format* format) const
268{
269 if ( index >= (int)( builtinFormats.size() + additionalFormats.size() ) ) {
270 return false;
271 }
272
273 int i = 0;
274 if ( index >= (int)builtinFormats.size() ) {
275 ///search in the additional formats
276 index -= builtinFormats.size();
277
278 for (std::list<Format>::const_iterator it = additionalFormats.begin(); it != additionalFormats.end(); ++it) {
279 if (i == index) {
280 assert( !it->isNull() );
281 *format = *it;
282
283 return true;
284 }
285 ++i;
286 }
287 } else {
288 ///search in the builtins formats
289 for (std::list<Format>::const_iterator it = builtinFormats.begin(); it != builtinFormats.end(); ++it) {
290 if (i == index) {
291 assert( !it->isNull() );
292 *format = *it;
293
294 return true;
295 }
296 ++i;
297 }
298 }
299
300 return false;
301}
302
303void
304ProjectPrivate::autoSetProjectDirectory(const QString& path)

Callers 3

onKnobValueChangedMethod · 0.80

Calls 4

sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
isNullMethod · 0.45

Tested by

no test coverage detected