diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-06-28 14:21:10 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-07-02 10:10:20 -0400 |
| commit | 41292e02bdebea8b09c2c11ee87221672e970cdf (patch) | |
| tree | ae130b7767feedc07bf0a5790824a9508ba588d1 /src/modinfo.cpp | |
| parent | b4c26c516412b2f7270be02494b85be9cad0cadb (diff) | |
changed how the mod url works:
- it is now independent from the nexus mod url
- it can be set in addition to having a valid mod id
- both urls can be displayed in the context menu
re-arranged some of the widgets on the nexus tab
added a track button
added a custom url checkbox and open in browser button
added a max-width to the browser
Diffstat (limited to 'src/modinfo.cpp')
| -rw-r--r-- | src/modinfo.cpp | 19 |
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; +} |
