mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-29 23:40:50 +02:00
cr feedback
This commit is contained in:
parent
061f084d9f
commit
c4d5d16eb3
1 changed files with 2 additions and 4 deletions
|
@ -1678,13 +1678,11 @@ QString getMarketplaceID(const QString& urlString) {
|
||||||
// a regex for the this is a PITA as there are several valid versions of uuids, and so
|
// a regex for the this is a PITA as there are several valid versions of uuids, and so
|
||||||
// lets strip out the uuid (if any) and try to create a UUID from the string, relying on
|
// lets strip out the uuid (if any) and try to create a UUID from the string, relying on
|
||||||
// QT to parse it
|
// QT to parse it
|
||||||
static const QRegularExpression re("^http:\\/\\/mpassets.highfidelity.com\\/([0-9A-Fa-f\\-]+)v[\\d]+\\/.*");
|
static const QRegularExpression re("^http:\\/\\/mpassets.highfidelity.com\\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})-v[\\d]+\\/.*");
|
||||||
QRegularExpressionMatch match = re.match(urlString);
|
QRegularExpressionMatch match = re.match(urlString);
|
||||||
if (match.hasMatch()) {
|
if (match.hasMatch()) {
|
||||||
QString matched = match.captured(1);
|
QString matched = match.captured(1);
|
||||||
// strip the hyphen off the end because my regex is crap
|
if (QUuid(matched).isNull()) {
|
||||||
matched.truncate(matched.size()-1);
|
|
||||||
if (QUuid() == QUuid(matched)) {
|
|
||||||
qDebug() << "invalid uuid for marketplaceID";
|
qDebug() << "invalid uuid for marketplaceID";
|
||||||
} else {
|
} else {
|
||||||
return matched;
|
return matched;
|
||||||
|
|
Loading…
Reference in a new issue