1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-16 19:31:02 +01:00

Merge pull request #4605 from Chocobozzz/fix_device_icon

Check if there is a current icon item in the device manager. Fixes #4604 #4555
This commit is contained in:
John Maguire 2014-11-05 12:11:48 +00:00
commit b2e0fe995e

View File

@ -252,9 +252,14 @@ void DeviceProperties::accept() {
ui_->transcode_format->itemData(ui_->transcode_format->currentIndex())
.toInt());
manager_->SetDeviceOptions(
index_.row(), ui_->name->text(),
ui_->icon->currentItem()->data(Qt::UserRole).toString(), mode, format);
// By default no icon is selected and thus no current item is selected
QString icon_name;
if (ui_->icon->currentItem() != nullptr) {
icon_name = ui_->icon->currentItem()->data(Qt::UserRole).toString();
}
manager_->SetDeviceOptions(index_.row(), ui_->name->text(), icon_name, mode,
format);
}
void DeviceProperties::OpenDevice() { manager_->Connect(index_.row()); }