| 2049 | } |
| 2050 | |
| 2051 | void DeprecationChecker::throwIf(DeprecationId id) |
| 2052 | { |
| 2053 | #if USE_BACKEND |
| 2054 | if (notOk) |
| 2055 | return; |
| 2056 | |
| 2057 | if (!check(id)) |
| 2058 | { |
| 2059 | try |
| 2060 | { |
| 2061 | Error::throwError(Error::ErrorCode::DeprecatedNode, (int)id); |
| 2062 | } |
| 2063 | catch (Error& e) |
| 2064 | { |
| 2065 | auto nodeTree = cppgen::ValueTreeIterator::findParentWithType(v, PropertyIds::Node); |
| 2066 | auto nId = nodeTree[PropertyIds::ID].toString(); |
| 2067 | |
| 2068 | if (auto node = n->getNodeWithId(nId)) |
| 2069 | { |
| 2070 | n->getExceptionHandler().addError(node, e); |
| 2071 | } |
| 2072 | } |
| 2073 | |
| 2074 | notOk = true; |
| 2075 | } |
| 2076 | #endif |
| 2077 | } |
| 2078 | |
| 2079 | bool DeprecationChecker::check(DeprecationId id) |
| 2080 | { |
nothing calls this directly
no test coverage detected