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

Method getNodeName

Gui/NodeCreationDialog.cpp:463–503  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

461}
462
463QString
464NodeCreationDialog::getNodeName(int *major) const
465{
466 QString name = _imp->textEdit->text();
467
468
469 for (PluginsMap::iterator it = _imp->items.begin(); it != _imp->items.end(); ++it) {
470 if (it->second.size() == 1) {
471 if ( ( *it->second.begin() )->generateUserFriendlyPluginID() == name ) {
472 Plugin* p = ( *it->second.begin() );
473 *major = p->getMajorVersion();
474 const QString& ret = p->getPluginID();
475 incrementPluginWeight(ret, *major);
476
477 return ret;
478 }
479 } else {
480 for (PluginVersionsOrdered::reverse_iterator it2 = it->second.rbegin(); it2 != it->second.rend(); ++it2) {
481 if ( it2 == it->second.rbegin() ) {
482 if ( (*it2)->generateUserFriendlyPluginID() == name ) {
483 *major = (*it2)->getMajorVersion();
484 const QString& ret = (*it2)->getPluginID();
485 incrementPluginWeight(ret, *major);
486
487 return ret;
488 }
489 } else {
490 if ( (*it2)->generateUserFriendlyPluginIDMajorEncoded() == name ) {
491 *major = (*it2)->getMajorVersion();
492 const QString& ret = (*it2)->getPluginID();
493 incrementPluginWeight(ret, *major);
494
495 return ret;
496 }
497 }
498 }
499 }
500 }
501
502 return QString();
503}
504
505void
506NodeCreationDialog::keyPressEvent(QKeyEvent* e)

Callers

nothing calls this directly

Calls 9

incrementPluginWeightFunction · 0.85
QStringClass · 0.50
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
getMajorVersionMethod · 0.45
getPluginIDMethod · 0.45

Tested by

no test coverage detected