kopia lustrzana https://github.com/f4exb/sdrangel
MainCore::getFeatureIndexFromId - Support Feature Ids without feature set index.
rodzic
cb89392c86
commit
29ae05a494
|
@ -612,12 +612,16 @@ bool MainCore::getDeviceAndChannelIndexFromId(const QString& channelId, unsigned
|
||||||
|
|
||||||
bool MainCore::getFeatureIndexFromId(const QString& featureId, unsigned int &featureSetIndex, unsigned int &featureIndex)
|
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);
|
QRegularExpressionMatch match = re.match(featureId);
|
||||||
|
|
||||||
if (match.hasMatch())
|
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();
|
featureIndex = match.capturedTexts()[2].toInt();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue