From 721e1475dc5ae8dfe52b31d93d65ac74cf5b65a6 Mon Sep 17 00:00:00 2001 From: f4exb Date: Thu, 10 Sep 2020 22:42:36 +0200 Subject: [PATCH] DeviceUISet: fixed deleteChannel. Fixes issue #625 --- sdrgui/device/deviceuiset.cpp | 1 - sdrgui/webapi/webapiadaptergui.cpp | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sdrgui/device/deviceuiset.cpp b/sdrgui/device/deviceuiset.cpp index ab468681f..db72ea499 100644 --- a/sdrgui/device/deviceuiset.cpp +++ b/sdrgui/device/deviceuiset.cpp @@ -171,7 +171,6 @@ void DeviceUISet::deleteChannel(int channelIndex) qPrintable(m_channelInstanceRegistrations[channelIndex].m_channelName), channelIndex); m_channelInstanceRegistrations[channelIndex].m_gui->destroy(); - m_channelInstanceRegistrations.removeAt(channelIndex); renameChannelInstances(); } } diff --git a/sdrgui/webapi/webapiadaptergui.cpp b/sdrgui/webapi/webapiadaptergui.cpp index 7bd1ec3dd..58e7d55b6 100644 --- a/sdrgui/webapi/webapiadaptergui.cpp +++ b/sdrgui/webapi/webapiadaptergui.cpp @@ -2277,9 +2277,9 @@ int WebAPIAdapterGUI::devicesetChannelDelete( else { error.init(); - *error.getMessage() = QString("There is no channel at index %1. There are %2 channels") + *error.getMessage() = QString("There is no channel at index %1. %2 channel(s) left") .arg(channelIndex) - .arg(channelIndex < deviceSet->getNumberOfChannels()); + .arg(deviceSet->getNumberOfChannels()); return 400; } }