| 835 | } |
| 836 | |
| 837 | void |
| 838 | NodeCollection::fixRelativeFilePaths(const std::string& projectPathName, |
| 839 | const std::string& newProjectPath, |
| 840 | bool blockEval) |
| 841 | { |
| 842 | NodesList nodes = getNodes(); |
| 843 | AppInstancePtr appInst = getApplication(); |
| 844 | if (!appInst) { |
| 845 | return; |
| 846 | } |
| 847 | ProjectPtr project = appInst->getProject(); |
| 848 | |
| 849 | for (NodesList::iterator it = nodes.begin(); it != nodes.end(); ++it) { |
| 850 | if ( (*it)->isActivated() ) { |
| 851 | (*it)->getEffectInstance()->beginChanges(); |
| 852 | |
| 853 | const KnobsVec& knobs = (*it)->getKnobs(); |
| 854 | for (U32 j = 0; j < knobs.size(); ++j) { |
| 855 | KnobStringBase* isString = dynamic_cast< KnobStringBase* >( knobs[j].get() ); |
| 856 | KnobString* isStringKnob = dynamic_cast<KnobString*>(isString); |
| 857 | if ( !isString || isStringKnob || ( knobs[j] == project->getEnvVarKnob() ) ) { |
| 858 | continue; |
| 859 | } |
| 860 | |
| 861 | std::string filepath = isString->getValue(); |
| 862 | |
| 863 | if ( !filepath.empty() ) { |
| 864 | if ( project->fixFilePath(projectPathName, newProjectPath, filepath) ) { |
| 865 | isString->setValue(filepath); |
| 866 | } |
| 867 | } |
| 868 | } |
| 869 | (*it)->getEffectInstance()->endChanges(blockEval); |
| 870 | |
| 871 | |
| 872 | NodeGroup* isGrp = (*it)->isEffectGroup(); |
| 873 | if (isGrp) { |
| 874 | isGrp->fixRelativeFilePaths(projectPathName, newProjectPath, blockEval); |
| 875 | } |
| 876 | } |
| 877 | } |
| 878 | } |
| 879 | |
| 880 | void |
| 881 | NodeCollection::fixPathName(const std::string& oldName, |
no test coverage detected