don't return a reference to a mutex-protected object!
| 1185 | |
| 1186 | // don't return a reference to a mutex-protected object! |
| 1187 | void |
| 1188 | Project::getProjectDefaultFormat(Format *f) const |
| 1189 | { |
| 1190 | assert(f); |
| 1191 | QMutexLocker l(&_imp->formatMutex); |
| 1192 | ChoiceOption formatSpec = _imp->formatKnob->getActiveEntry(); |
| 1193 | // use the label here, because the id does not contain the format specifications. |
| 1194 | // see ProjectPrivate::generateStringFromFormat() |
| 1195 | #pragma message WARN("TODO: can't we store the format somewhere instead of parsing the label???") |
| 1196 | if ( !formatSpec.label.empty() ) { |
| 1197 | ProjectPrivate::generateFormatFromString(QString::fromUtf8( formatSpec.label.c_str() ), f); |
| 1198 | } else { |
| 1199 | _imp->findFormat(_imp->formatKnob->getValue(), f); |
| 1200 | } |
| 1201 | } |
| 1202 | |
| 1203 | bool |
| 1204 | Project::getProjectFormatAtIndex(int index, |
no test coverage detected