mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-02-07 15:08:24 +00:00
fix(ui/views/App/Settings): avoid useless Component.onCompleted on ComboBox
This commit is contained in:
parent
83bf254d39
commit
9f7f455a73
2 changed files with 16 additions and 19 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue