| 6100 | } // Node::disconnectInput |
| 6101 | |
| 6102 | int |
| 6103 | Node::disconnectInputInternal(Node* input, bool useGuiValues) |
| 6104 | { |
| 6105 | assert(_imp->inputsInitialized); |
| 6106 | int found = -1; |
| 6107 | NodePtr inputShared; |
| 6108 | { |
| 6109 | QMutexLocker l(&_imp->inputsMutex); |
| 6110 | if (!useGuiValues) { |
| 6111 | for (std::size_t i = 0; i < _imp->inputs.size(); ++i) { |
| 6112 | NodePtr curInput = _imp->inputs[i].lock(); |
| 6113 | if (curInput.get() == input) { |
| 6114 | inputShared = curInput; |
| 6115 | found = (int)i; |
| 6116 | break; |
| 6117 | } |
| 6118 | } |
| 6119 | } else { |
| 6120 | for (std::size_t i = 0; i < _imp->guiInputs.size(); ++i) { |
| 6121 | NodePtr curInput = _imp->guiInputs[i].lock(); |
| 6122 | if (curInput.get() == input) { |
| 6123 | inputShared = curInput; |
| 6124 | found = (int)i; |
| 6125 | break; |
| 6126 | } |
| 6127 | } |
| 6128 | } |
| 6129 | } |
| 6130 | if (found != -1) { |
| 6131 | { |
| 6132 | QMutexLocker l(&_imp->inputsMutex); |
| 6133 | if (!useGuiValues) { |
| 6134 | _imp->inputs[found].reset(); |
| 6135 | _imp->guiInputs[found].reset(); |
| 6136 | } else { |
| 6137 | _imp->guiInputs[found].reset(); |
| 6138 | } |
| 6139 | } |
| 6140 | input->disconnectOutput(useGuiValues, this); |
| 6141 | Q_EMIT inputChanged(found); |
| 6142 | bool mustCallEnd = false; |
| 6143 | if (!useGuiValues) { |
| 6144 | beginInputEdition(); |
| 6145 | mustCallEnd = true; |
| 6146 | onInputChanged(found); |
| 6147 | } |
| 6148 | bool creatingNodeTree = getApp()->isCreatingNodeTree(); |
| 6149 | if (!creatingNodeTree) { |
| 6150 | ///Recompute the hash |
| 6151 | if ( !getApp()->getProject()->isProjectClosing() ) { |
| 6152 | computeHash(); |
| 6153 | } |
| 6154 | } |
| 6155 | |
| 6156 | |
| 6157 | _imp->ifGroupForceHashChangeOfInputs(); |
| 6158 | |
| 6159 | std::string inputChangedCB = getInputChangedCallback(); |
no test coverage detected