Check if there is a current icon item in the device manager. Fixes #4604 #4555

This commit is contained in:
Chocobozzz 2014-11-04 21:46:10 +01:00
parent 797236fc60
commit 942fda88bf

View File

@ -252,9 +252,14 @@ void DeviceProperties::accept() {
ui_->transcode_format->itemData(ui_->transcode_format->currentIndex()) ui_->transcode_format->itemData(ui_->transcode_format->currentIndex())
.toInt()); .toInt());
// 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( manager_->SetDeviceOptions(
index_.row(), ui_->name->text(), index_.row(), ui_->name->text(), icon_name, mode,format);
ui_->icon->currentItem()->data(Qt::UserRole).toString(), mode, format);
} }
void DeviceProperties::OpenDevice() { manager_->Connect(index_.row()); } void DeviceProperties::OpenDevice() { manager_->Connect(index_.row()); }