| 878 | } |
| 879 | |
| 880 | void |
| 881 | NodeCollection::fixPathName(const std::string& oldName, |
| 882 | const std::string& newName) |
| 883 | { |
| 884 | NodesList nodes = getNodes(); |
| 885 | AppInstancePtr appInst = getApplication(); |
| 886 | if (!appInst) { |
| 887 | return; |
| 888 | } |
| 889 | ProjectPtr project = appInst->getProject(); |
| 890 | |
| 891 | for (NodesList::iterator it = nodes.begin(); it != nodes.end(); ++it) { |
| 892 | if ( (*it)->isActivated() ) { |
| 893 | const KnobsVec& knobs = (*it)->getKnobs(); |
| 894 | for (U32 j = 0; j < knobs.size(); ++j) { |
| 895 | KnobStringBase* isString = dynamic_cast< KnobStringBase* >( knobs[j].get() ); |
| 896 | KnobString* isStringKnob = dynamic_cast<KnobString*>(isString); |
| 897 | if ( !isString || isStringKnob || ( knobs[j] == project->getEnvVarKnob() ) ) { |
| 898 | continue; |
| 899 | } |
| 900 | |
| 901 | std::string filepath = isString->getValue(); |
| 902 | |
| 903 | if ( ( filepath.size() >= (oldName.size() + 2) ) && |
| 904 | ( filepath[0] == '[') && |
| 905 | ( filepath[oldName.size() + 1] == ']') && |
| 906 | ( filepath.substr( 1, oldName.size() ) == oldName) ) { |
| 907 | filepath.replace(1, oldName.size(), newName); |
| 908 | isString->setValue(filepath); |
| 909 | } |
| 910 | } |
| 911 | |
| 912 | NodeGroup* isGrp = (*it)->isEffectGroup(); |
| 913 | if (isGrp) { |
| 914 | isGrp->fixPathName(oldName, newName); |
| 915 | } |
| 916 | } |
| 917 | } |
| 918 | } |
| 919 | |
| 920 | bool |
| 921 | NodeCollection::checkIfNodeLabelExists(const std::string & n, |
no test coverage detected