Commit 9f7f455a authored by Ronan Abhamon's avatar Ronan Abhamon

fix(ui/views/App/Settings): avoid useless `Component.onCompleted` on `ComboBox`

parent 83bf254d
......@@ -16,11 +16,10 @@ TabContainer {
label: qsTr('playbackDeviceLabel')
ComboBox {
model: SettingsModel.audioDevices
Component.onCompleted: currentIndex = Utils.findIndex(model, function (device) {
currentIndex: Utils.findIndex(model, function (device) {
return device === SettingsModel.playbackDevice
})
model: SettingsModel.audioDevices
onActivated: SettingsModel.playbackDevice = model[index]
}
......@@ -32,11 +31,10 @@ TabContainer {
label: qsTr('captureDeviceLabel')
ComboBox {
model: SettingsModel.audioDevices
Component.onCompleted: currentIndex = Utils.findIndex(model, function (device) {
currentIndex: Utils.findIndex(model, function (device) {
return device === SettingsModel.captureDevice
})
model: SettingsModel.audioDevices
onActivated: SettingsModel.captureDevice = model[index]
}
......@@ -48,11 +46,10 @@ TabContainer {
label: qsTr('ringerDeviceLabel')
ComboBox {
model: SettingsModel.audioDevices
Component.onCompleted: currentIndex = Utils.findIndex(model, function (device) {
currentIndex: Utils.findIndex(model, function (device) {
return device === SettingsModel.ringerDevice
})
model: SettingsModel.audioDevices
onActivated: SettingsModel.ringerDevice = model[index]
}
......
......@@ -16,11 +16,10 @@ TabContainer {
label: qsTr('videoInputDeviceLabel')
ComboBox {
model: SettingsModel.videoDevices
Component.onCompleted: currentIndex = Utils.findIndex(model, function (device) {
currentIndex: Utils.findIndex(model, function (device) {
return device === SettingsModel.videoDevice
})
model: SettingsModel.videoDevices
onActivated: SettingsModel.videoDevice = model[index]
}
......@@ -32,6 +31,14 @@ TabContainer {
label: qsTr('videoPresetLabel')
ComboBox {
currentIndex: {
var preset = SettingsModel.videoPreset
return Number(Utils.findIndex([ 'default', 'high-fps', 'custom' ], function (value) {
return preset === value
}))
}
model: ListModel {
id: presets
......@@ -53,13 +60,6 @@ TabContainer {
textRole: 'key'
Component.onCompleted: {
var preset = SettingsModel.videoPreset
currentIndex = Number(Utils.findIndex([ 'default', 'high-fps', 'custom' ], function (value) {
return preset === value
}))
}
onActivated: SettingsModel.videoPreset = presets.get(index).value
}
}
......
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