mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-14 11:46:34 +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
|
||||
// lets strip out the uuid (if any) and try to create a UUID from the string, relying on
|
||||
// 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);
|
||||
if (match.hasMatch()) {
|
||||
QString matched = match.captured(1);
|
||||
// strip the hyphen off the end because my regex is crap
|
||||
matched.truncate(matched.size()-1);
|
||||
if (QUuid() == QUuid(matched)) {
|
||||
if (QUuid(matched).isNull()) {
|
||||
qDebug() << "invalid uuid for marketplaceID";
|
||||
} else {
|
||||
return matched;
|
||||
|
|
Loading…
Reference in a new issue