summaryrefslogtreecommitdiff
path: root/src/modinfodialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modinfodialog.cpp')
-rw-r--r--src/modinfodialog.cpp13
1 files changed, 5 insertions, 8 deletions
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 <http://www.gnu.org/licenses/>.
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<IPluginGame*>();
- 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<QLineEdit*>("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<IPluginGame*>();
- QString nexusLink = QString("%1/downloads/file.php?id=%2").arg(game->getNexusDisplayURL()).arg(modID);
+ QString nexusLink = NexusInterface::instance()->getModURL(modID);
QLabel *visitNexusLabel = findChild<QLabel*>("visitNexusLabel");
visitNexusLabel->setText(tr("<a href=\"%1\">Visit on Nexus</a>").arg(nexusLink));
visitNexusLabel->setToolTip(nexusLink);
-
if (m_ModInfo->getNexusDescription().isEmpty() ||
QDateTime::currentDateTime() > m_ModInfo->getLastNexusQuery().addDays(1)) {
refreshNexusData(modID);