From 5d88998fa19f79ec768f5a4b3ccd686913ab5209 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Wed, 6 May 2015 16:55:35 +0200 Subject: [PATCH] fixed device edit notification --- libguh/devicemanager.cpp | 7 +++++-- server/guhcore.cpp | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libguh/devicemanager.cpp b/libguh/devicemanager.cpp index 5f9ed0f0..cd186bd1 100644 --- a/libguh/devicemanager.cpp +++ b/libguh/devicemanager.cpp @@ -384,8 +384,8 @@ DeviceManager::DeviceError DeviceManager::editDevice(const DeviceId &deviceId, c storeConfiguredDevices(); postSetupDevice(device); device->setupCompleted(); - emit deviceParamsChanged(device); + return DeviceErrorNoError; } @@ -858,7 +858,10 @@ void DeviceManager::slotDeviceSetupFinished(Device *device, DeviceManager::Devic storeConfiguredDevices(); device->setupCompleted(); + // TODO: recover old params.?? + + emit deviceParamsChanged(device); emit deviceEditFinished(device, DeviceError::DeviceErrorSetupFailed); } qWarning() << QString("Error in device setup. Device %1 (%2) will not be functional.").arg(device->name()).arg(device->id().toString()); @@ -893,8 +896,8 @@ void DeviceManager::slotDeviceSetupFinished(Device *device, DeviceManager::Devic m_asyncDeviceEdit.removeAll(device); storeConfiguredDevices(); device->setupCompleted(); - emit deviceEditFinished(device, DeviceManager::DeviceErrorNoError); emit deviceParamsChanged(device); + emit deviceEditFinished(device, DeviceManager::DeviceErrorNoError); return; } diff --git a/server/guhcore.cpp b/server/guhcore.cpp index 5212c0b4..660be306 100644 --- a/server/guhcore.cpp +++ b/server/guhcore.cpp @@ -369,6 +369,7 @@ GuhCore::GuhCore(QObject *parent) : connect(m_deviceManager, &DeviceManager::eventTriggered, this, &GuhCore::gotEvent); connect(m_deviceManager, &DeviceManager::deviceStateChanged, this, &GuhCore::deviceStateChanged); connect(m_deviceManager, &DeviceManager::deviceAdded, this, &GuhCore::deviceAdded); + connect(m_deviceManager, &DeviceManager::deviceParamsChanged, this, &GuhCore::deviceParamsChanged); connect(m_deviceManager, &DeviceManager::deviceRemoved, this, &GuhCore::deviceRemoved); connect(m_deviceManager, &DeviceManager::actionExecutionFinished, this, &GuhCore::actionExecutionFinished); connect(m_deviceManager, &DeviceManager::devicesDiscovered, this, &GuhCore::devicesDiscovered);