New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIX(client): Properly show currently selected audio device in settings dialog #4974
FIX(client): Properly show currently selected audio device in settings dialog #4974
Conversation
dda381d
to
a761ba1
Compare
This comment has been minimized.
This comment has been minimized.
Works for me with the ALSA Backend. 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Imo
auto
is used way too often in this PR as in many places it completely hides the type of variables. This is an important information that I want to see immediately when reading through the code.
Using this for iterators is fine and also using it for the result of casts or as a loop variable in a ranged for. Using it for storing the value of a function is not appropriate (imo). - The functions should be marked with the
override
keyword. Potentially this makes it necessary to prepend a REFAC commit that marks other functions withoverride
already.
a761ba1
to
e9a5f12
Compare
Let's do it in a dedicated pull request, because I would also like to replace all For reference: qt/qtspeech@aa24a10 |
@@ -138,6 +138,7 @@ class AudioInputRegistrar { | |||
AudioInputRegistrar(const QString &n, int priority = 0); | |||
virtual ~AudioInputRegistrar(); | |||
virtual AudioInput *create() = 0; | |||
virtual const QVariant getDeviceChoice() = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We return QVariant
by value, so why do we make it const
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency with getDeviceChoices()
, which returns a const
list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That also returns by value, right? In that case that doesn't seem to make too much sense either 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed.
@@ -65,6 +65,7 @@ class AudioOutputRegistrar { | |||
AudioOutputRegistrar(const QString &n, int priority = 0); | |||
virtual ~AudioOutputRegistrar(); | |||
virtual AudioOutput *create() = 0; | |||
virtual const QVariant getDeviceChoice() = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above
…s dialog Every audio backend implementation was moving the current device at the top. This commit replaces that logic by selecting the current device in the combobox.
e9a5f12
to
4627a83
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally I think the const
thing should be fixed as well (separate commit) though this is not strictly related to the changes in this PR
I honestly would leave it as it is, we don't have to change the returned variable's value anyway. |
Every audio backend implementation was moving the current device at the top.
This commit replaces that logic by selecting the current device in the combobox.
Before
After