don't crash if server has no default sink/source set

git-svn-id: file:///home/lennart/svn/public/pavucontrol/trunk@68 c17c95f2-f111-0410-90bf-f30a9569010c
This commit is contained in:
Lennart Poettering 2008-03-28 18:44:46 +00:00
parent 98a7f6c5d1
commit c80c710d05
1 changed files with 5 additions and 5 deletions

View File

@ -824,6 +824,9 @@ void MainWindow::updateClient(const pa_client_info &info) {
void MainWindow::updateServer(const pa_server_info &info) {
defaultSourceName = info.default_source_name ? info.default_source_name : "";
defaultSinkName = info.default_sink_name ? info.default_sink_name : "";
for (std::map<uint32_t, SinkWidget*>::iterator i = sinkWidgets.begin(); i != sinkWidgets.end(); ++i) {
SinkWidget *w = i->second;
@ -831,7 +834,7 @@ void MainWindow::updateServer(const pa_server_info &info) {
continue;
w->updating = true;
w->defaultMenuItem.set_active(w->name == info.default_sink_name);
w->defaultMenuItem.set_active(w->name == defaultSinkName);
w->updating = false;
}
@ -842,12 +845,9 @@ void MainWindow::updateServer(const pa_server_info &info) {
continue;
w->updating = true;
w->defaultMenuItem.set_active(w->name == info.default_source_name);
w->defaultMenuItem.set_active(w->name == defaultSourceName);
w->updating = false;
}
defaultSourceName = info.default_source_name;
defaultSinkName = info.default_sink_name;
}
void MainWindow::updateDeviceVisibility() {