From 942fda88bfad4a979632aa29b55afb328c280f37 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 4 Nov 2014 21:46:10 +0100 Subject: [PATCH] Check if there is a current icon item in the device manager. Fixes #4604 #4555 --- src/devices/deviceproperties.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/devices/deviceproperties.cpp b/src/devices/deviceproperties.cpp index cc8f85067..0dbf64dd2 100644 --- a/src/devices/deviceproperties.cpp +++ b/src/devices/deviceproperties.cpp @@ -252,9 +252,14 @@ void DeviceProperties::accept() { ui_->transcode_format->itemData(ui_->transcode_format->currentIndex()) .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( - index_.row(), ui_->name->text(), - ui_->icon->currentItem()->data(Qt::UserRole).toString(), mode, format); + index_.row(), ui_->name->text(), icon_name, mode,format); } void DeviceProperties::OpenDevice() { manager_->Connect(index_.row()); }