From 29ae05a494240ff6eeae333231c66551ee836427 Mon Sep 17 00:00:00 2001 From: srcejon Date: Mon, 18 Mar 2024 14:10:02 +0000 Subject: [PATCH] MainCore::getFeatureIndexFromId - Support Feature Ids without feature set index. --- sdrbase/maincore.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sdrbase/maincore.cpp b/sdrbase/maincore.cpp index 18e1c3a8b..6eca8f287 100644 --- a/sdrbase/maincore.cpp +++ b/sdrbase/maincore.cpp @@ -612,12 +612,16 @@ bool MainCore::getDeviceAndChannelIndexFromId(const QString& channelId, unsigned bool MainCore::getFeatureIndexFromId(const QString& featureId, unsigned int &featureSetIndex, unsigned int &featureIndex) { - const QRegularExpression re("[F]([0-9]+):([0-9]+)"); + const QRegularExpression re("F([0-9]+)?:([0-9]+)"); QRegularExpressionMatch match = re.match(featureId); if (match.hasMatch()) { - featureSetIndex = match.capturedTexts()[1].toInt(); + if (match.capturedTexts()[1].isEmpty()) { + featureSetIndex = 0; + } else { + featureSetIndex = match.capturedTexts()[1].toInt(); + } featureIndex = match.capturedTexts()[2].toInt(); return true; }