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/modinfodialog.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/modinfodialog.cpp') diff --git a/src/modinfodialog.cpp b/src/modinfodialog.cpp index 70ae5deb..687f641e 100644 --- a/src/modinfodialog.cpp +++ b/src/modinfodialog.cpp @@ -44,6 +44,7 @@ along with Mod Organizer. If not, see . using namespace MOBase; +using namespace MOShared; class ModFileListWidget : public QListWidgetItem { @@ -689,9 +690,9 @@ void ModInfoDialog::on_visitNexusLabel_linkActivated(const QString &link) void ModInfoDialog::linkClicked(const QUrl &url) { - //FIXME: See elsewhere. This needs to be a property of the installed mod. - IPluginGame *game = qApp->property("managed_game").value(); - if (game->isRelatedURL(url)) { + //Ideally we'd ask the mod for the game and the web service then pass the game + //and URL to the web service + if (NexusInterface::instance()->isURLGameRelated(url)) { this->close(); emit nexusLinkActivated(url.toString()); } else { @@ -835,15 +836,11 @@ void ModInfoDialog::activateNexusTab() QLineEdit *modIDEdit = findChild("modIDEdit"); int modID = modIDEdit->text().toInt(); if (modID != 0) { - //FIXME: We should remember the game for which this mod was installed in the - //modInfo and get the web page via that. - IPluginGame *game = qApp->property("managed_game").value(); - QString nexusLink = QString("%1/downloads/file.php?id=%2").arg(game->getNexusDisplayURL()).arg(modID); + QString nexusLink = NexusInterface::instance()->getModURL(modID); QLabel *visitNexusLabel = findChild("visitNexusLabel"); visitNexusLabel->setText(tr("Visit on Nexus").arg(nexusLink)); visitNexusLabel->setToolTip(nexusLink); - if (m_ModInfo->getNexusDescription().isEmpty() || QDateTime::currentDateTime() > m_ModInfo->getLastNexusQuery().addDays(1)) { refreshNexusData(modID); -- cgit v1.3.1