mirror of
https://github.com/theCheeseboard/thedesk.git
synced 2025-01-23 02:42:02 -05:00
Fix crash when sound device is removed
This commit is contained in:
parent
3f1791afdc
commit
38dc193a9f
2 changed files with 4 additions and 3 deletions
|
@ -23,6 +23,7 @@
|
|||
#include <Context>
|
||||
#include <the-libs_global.h>
|
||||
#include <QMenu>
|
||||
#include <QPointer>
|
||||
#include "common.h"
|
||||
|
||||
struct QuickWidgetSinkInputPrivate {
|
||||
|
@ -129,12 +130,12 @@ void QuickWidgetSinkInput::sinkAdded(PulseAudioQt::Sink* sink) {
|
|||
QAction* action = new QAction(this);
|
||||
action->setCheckable(true);
|
||||
|
||||
connect(sink, &PulseAudioQt::Sink::propertiesChanged, this, [ = ] {
|
||||
connect(sink, &PulseAudioQt::Sink::propertiesChanged, action, [ = ] {
|
||||
action->setText(Common::nameForSink(sink));
|
||||
});
|
||||
action->setText(Common::nameForSink(sink));
|
||||
|
||||
connect(d->sinkInput, &PulseAudioQt::SinkInput::deviceIndexChanged, this, [ = ] {
|
||||
connect(d->sinkInput, &PulseAudioQt::SinkInput::deviceIndexChanged, action, [ = ] {
|
||||
action->setChecked(sink->index() == d->sinkInput->deviceIndex());
|
||||
});
|
||||
action->setChecked(sink->index() == d->sinkInput->deviceIndex());
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
<context>
|
||||
<name>QuickWidgetSinkInput</name>
|
||||
<message>
|
||||
<location filename="../quickwidgetsinkinput.cpp" line="62"/>
|
||||
<location filename="../quickwidgetsinkinput.cpp" line="63"/>
|
||||
<source>Play on</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
|
Loading…
Reference in a new issue