Commit 667aa7e1 authored by Ronan Abhamon's avatar Ronan Abhamon

fix(ui/views/App/Settings/SettingsVideo): fix a crash if the app was built without video support

parent 6e440461
......@@ -182,6 +182,16 @@ void SettingsModel::setVideoFramerate (int framerate) {
inline QVariantMap createMapFromVideoDefinition (const shared_ptr<const linphone::VideoDefinition> &definition) {
QVariantMap map;
if (!definition) {
Q_ASSERT(!CoreManager::getInstance()->getCore()->videoSupported());
map["name"] = QStringLiteral("Bad EGG");
map["width"] = QStringLiteral("?????");
map["height"] = QStringLiteral("?????");
return map;
}
map["name"] = ::Utils::coreStringToAppString(definition->getName());
map["width"] = definition->getWidth();
map["height"] = definition->getHeight();
......
......@@ -28,9 +28,9 @@ TabContainer {
label: qsTr('videoInputDeviceLabel')
ComboBox {
currentIndex: Utils.findIndex(model, function (device) {
currentIndex: Number(Utils.findIndex(model, function (device) {
return device === SettingsModel.videoDevice
})
})) // Number cast => Index is null if app does not support video.
model: SettingsModel.videoDevices
onActivated: SettingsModel.videoDevice = model[index]
......@@ -74,9 +74,9 @@ TabContainer {
label: qsTr('videoSizeLabel')
ComboBox {
currentIndex: Utils.findIndex(model, function (definition) {
currentIndex: Number(Utils.findIndex(model, function (definition) {
return definition.value.name === SettingsModel.videoDefinition.name
})
})) // Number cast => Index is null if app does not support video.
model: SettingsModel.supportedVideoDefinitions.map(function (definition) {
return {
key: definition.name + ' (' + definition.width + 'x' + definition.height + ')',
......
linphone @ df4cc8d7
Subproject commit 2b93067a78a0373f24ee868d5bd0523f6be15d14
Subproject commit df4cc8d7079e6191bf0bb389da809736c5607b70
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment