diff options
author | Utkarsh Tiwari <utkarsh02t@gmail.com> | 2022-08-07 00:34:31 +0530 |
---|---|---|
committer | Utkarsh Tiwari <utkarsh02t@gmail.com> | 2022-09-05 12:12:02 +0530 |
commit | 923927ae45dd10be5c3c854d568dae6751ccb87e (patch) | |
tree | 343d8b15a514ade7ff5734c480f6d9d64a37f933 /src/qcam/cam_select_dialog.cpp | |
parent | f03da23b56bed065dace3cf3e7bf027f700e1085 (diff) |
qcam: Support Hotplug for Camera Selection Dialog
Currently if there is HotPlug event when the user is on the Camera
selection dialog, the QComboBox doesn't update to reflect the change.
Add support for hotplugging / unplugging cameras.
Signed-off-by: Utkarsh Tiwari <utkarsh02t@gmail.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/qcam/cam_select_dialog.cpp')
-rw-r--r-- | src/qcam/cam_select_dialog.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/qcam/cam_select_dialog.cpp b/src/qcam/cam_select_dialog.cpp index a49d822b..07f53f40 100644 --- a/src/qcam/cam_select_dialog.cpp +++ b/src/qcam/cam_select_dialog.cpp @@ -48,3 +48,15 @@ std::string CameraSelectorDialog::getCameraId() { return cameraIdComboBox_->currentText().toStdString(); } + +/* Hotplug / Unplug Support. */ +void CameraSelectorDialog::addCamera(QString cameraId) +{ + cameraIdComboBox_->addItem(cameraId); +} + +void CameraSelectorDialog::removeCamera(QString cameraId) +{ + int cameraIndex = cameraIdComboBox_->findText(cameraId); + cameraIdComboBox_->removeItem(cameraIndex); +} |