| 461 | } |
| 462 | |
| 463 | QString |
| 464 | NodeCreationDialog::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 | |
| 505 | void |
| 506 | NodeCreationDialog::keyPressEvent(QKeyEvent* e) |
nothing calls this directly
no test coverage detected