display cleaner name in camera selection#242
Merged
saeugetier merged 1 commit intoFeb 15, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request refactors camera device representation throughout the application from simple strings to structured objects with separate text (display name) and value (unique identifier) fields. This standardization improves consistency between the UI layer and backend, enabling cleaner display names (e.g., "GPhoto - Canon EOS" or "Libcamera - Model Name") while maintaining unique identifiers for device selection.
Changes:
- Updated C++ backend methods (
availableCameras()) to returnQVariantListof objects withtextandvaluefields instead ofQStringList - Modified QML UI components to use ComboBox
textRole/valueRoleproperties andcurrentValuefor camera selection - Enhanced camera display names with prefixes ("GPhoto - ", "Libcamera - ") and model information when available
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/libcameracamera.h | Changed return types from QStringList to QVariantList; added QVariantList include |
| src/libcameracamera.cpp | Implemented structured camera objects with text/value fields; added QVariantMap include and property retrieval |
| src/gphotocamera.h | Changed return types from QStringList to QVariantList; added QVariantList include |
| src/gphotocamera.cpp | Implemented structured camera objects with text/value fields for GPhoto devices |
| qml/content/CameraSource.qml | Updated camera matching logic to use .value property; fixed loop variable shadowing |
| qml/SettingsMenuForm.ui.qml | Added textRole and valueRole to ComboBox for proper display/value separation |
| qml/SettingsMenu.qml | Updated camera list population to create objects with text/value properties |
| qml/Application.qml | Changed event handler from onCurrentTextChanged to onCurrentValueChanged |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request standardizes how camera devices are represented and selected throughout the application. It changes the camera lists from simple strings to structured objects with separate
text(display name) andvalue(unique identifier) fields, ensuring consistency across the UI, QML, and C++ backend. This improves the handling of camera selection and display, especially as more camera types are supported.Camera device representation and selection:
QStringListtoQVariantListof objects withtextandvaluefields in both the C++ backend (e.g.,GPhotoCameraDevice::availableCameras,LibcameraDevice::availableCameras) and QML frontend. This enables richer, more consistent camera information in the UI. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]SettingsMenuForm.ui.qml,SettingsMenu.qml) to use the newtextRoleandvalueRoleproperties, and to populate the camera list with objects instead of strings. [1] [2]Application.qml,CameraSource.qml) to use the newcurrentValueproperty for camera selection, and to compare/select cameras by theirvaluefield rather than by string equality. [1] [2] [3]Backend improvements:
GPhoto -orLibcamera -and using the camera model name when available) and a unique identifier for each camera. [1] [2]Build/compatibility:
QVariantListandQVariantMapto support the new camera object representation. [1] [2] [3]