| 158 | } |
| 159 | |
| 160 | bool EELParser::canLoadDefaults() |
| 161 | { |
| 162 | if (!isFileLoaded()) |
| 163 | { |
| 164 | return false; |
| 165 | } |
| 166 | |
| 167 | for(auto* prop : std::as_const(properties)) |
| 168 | { |
| 169 | if(prop->getType() == EELPropertyType::NumberRange) |
| 170 | { |
| 171 | auto* nr = dynamic_cast<EELNumberRangeProperty<float>*>(prop); |
| 172 | |
| 173 | if(prop->hasDefault() && qFloatCompare(nr->getDefault(), nr->getValue()) == false) |
| 174 | { |
| 175 | return true; |
| 176 | } |
| 177 | } |
| 178 | else if(prop->getType() == EELPropertyType::List) |
| 179 | { |
| 180 | auto* nr = dynamic_cast<EELListProperty*>(prop); |
| 181 | |
| 182 | if(prop->hasDefault() && nr->getDefault() != nr->getValue()) |
| 183 | { |
| 184 | return true; |
| 185 | } |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | return false; |
| 190 | } |
| 191 | |
| 192 | bool EELParser::isFileLoaded() |
| 193 | { |
no test coverage detected