From 2025145ff6e1ddf1b433eae2f9418e10a6fea82e Mon Sep 17 00:00:00 2001 From: Thomas Tanner Date: Thu, 26 Nov 2015 21:02:45 +0000 Subject: Replaced the IPluginGame getNexusDisplayURL with some APIs in NexusInterface It makes more sense to have them here as they have very little to do with the game, more to do with the origin of the mod. --- src/nexusinterface.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/nexusinterface.cpp') diff --git a/src/nexusinterface.cpp b/src/nexusinterface.cpp index b6843c57..7a0b0a17 100644 --- a/src/nexusinterface.cpp +++ b/src/nexusinterface.cpp @@ -240,6 +240,22 @@ void NexusInterface::interpretNexusFileName(const QString &fileName, QString &mo } } +bool NexusInterface::isURLGameRelated(const QUrl &url) const +{ + QString const name(url.toString()); + return name.startsWith(getGameURL() + "/") || + name.startsWith("http://" + m_Game->getNexusName().toLower() + ".nexusmods.com/mods/"); +} + +QString NexusInterface::getGameURL() const +{ + return "http://www.nexusmods.com/" + m_Game->getNexusName().toLower(); +} + +QString NexusInterface::getModURL(int modID) const +{ + return QString("%1/mods/%2").arg(getGameURL()).arg(modID); +} int NexusInterface::requestDescription(int modID, QObject *receiver, QVariant userData, const QString &subModule, MOBase::IPluginGame const *game) -- cgit v1.3.1