summaryrefslogtreecommitdiff
path: root/src/modinfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modinfo.cpp')
-rw-r--r--src/modinfo.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/modinfo.cpp b/src/modinfo.cpp
index bc2979ef..585d4963 100644
--- a/src/modinfo.cpp
+++ b/src/modinfo.cpp
@@ -520,3 +520,22 @@ void ModInfo::testValid()
dirIter.next();
}
}
+
+QUrl ModInfo::parseCustomURL() const
+{
+ if (!hasCustomURL() || getCustomURL().isEmpty()) {
+ return {};
+ }
+
+ const auto url = QUrl::fromUserInput(getCustomURL());
+
+ if (!url.isValid()) {
+ qCritical()
+ << "mod '" << name() << "' has an invalid custom url "
+ << "'" << getCustomURL() << "'";
+
+ return {};
+ }
+
+ return url;
+}