summaryrefslogtreecommitdiff
path: root/src/modinfodialog.cpp
diff options
context:
space:
mode:
authorThomas Tanner <trtanner@btinternet.com>2015-11-26 21:02:45 +0000
committerThomas Tanner <trtanner@btinternet.com>2015-11-26 21:02:45 +0000
commit2025145ff6e1ddf1b433eae2f9418e10a6fea82e (patch)
treeb8ebd015f5e718f03a9f55389e53d43fd0557d31 /src/modinfodialog.cpp
parent1b1fc247dfc4eade8ab34679ca7c58e850a0a1a3 (diff)
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.
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);