don't return a reference to a mutex-protected object!
| 1085 | |
| 1086 | // don't return a reference to a mutex-protected object! |
| 1087 | void |
| 1088 | Project::getProjectDefaultFormat(Format *f) const |
| 1089 | { |
| 1090 | assert(f); |
| 1091 | QMutexLocker l(&_imp->formatMutex); |
| 1092 | ChoiceOption formatSpec = _imp->formatKnob->getActiveEntry(); |
| 1093 | // use the label here, because the id does not contain the format specifications. |
| 1094 | // see ProjectPrivate::generateStringFromFormat() |
| 1095 | #pragma message WARN("TODO: can't we store the format somewhere instead of parsing the label???") |
| 1096 | if ( !formatSpec.label.empty() ) { |
| 1097 | ProjectPrivate::generateFormatFromString(QString::fromUtf8( formatSpec.label.c_str() ), f); |
| 1098 | } else { |
| 1099 | _imp->findFormat(_imp->formatKnob->getValue(), f); |
| 1100 | } |
| 1101 | } |
| 1102 | |
| 1103 | bool |
| 1104 | Project::getProjectFormatAtIndex(int index, |
no test coverage detected