Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add startDownloadNexusFileForGame #164

Merged

Conversation

JonathanFeenstra
Copy link
Contributor

Requested by @FlayaN on Discord

@qudix
Copy link
Contributor

qudix commented Dec 31, 2024

I think it would be ideal to avoid function overloads, especially with virtual functions. The compiler is free to put them in any order which is annoying. Maybe something like startDownloadNexusFileEx or startDownloadNexusGameFile

@JonathanFeenstra
Copy link
Contributor Author

We already use function overloads in some other places though, including for virtual functions like IModList::setActive. Would it still be better to rename the function despite the inconsistency?

@qudix
Copy link
Contributor

qudix commented Dec 31, 2024

Yes, current uses does not preclude changing course for the better.

@JonathanFeenstra JonathanFeenstra changed the title Add startDownloadNexusFile overload with game name Add startDownloadNexusFileForGame Jan 1, 2025
@Holt59
Copy link
Member

Holt59 commented Jan 2, 2025

I think it would be ideal to avoid function overloads, especially with virtual functions. The compiler is free to put them in any order which is annoying. Maybe something like startDownloadNexusFileEx or startDownloadNexusGameFile

I don't really think that's an issue - The way the code is currently written, most MO2 updates breaks the uibase API anyway so the order does not really matter.

* @param fileID id of the file to download
* @return an id by which the download will be identified
*/
virtual int startDownloadNexusFileForGame(const QString& gameName, int modID,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use the game ID instead of the game name, I think those are less likely to be changed in the future (if I remember correctly, Nexus has changed the game short names a few times in the past which was kind of annoying for MO2).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Internally, the function uses the game name anyway (QString("nxm://%1/mods/%2/files/%3").arg(gameName).arg(modID).arg(fileID))), so there's no way around that unfortunately. I think Nexus is now more careful with these kind of changes though, at least in ModOrganizer2/modorganizer#2138 we were notified in advance.

@Holt59 Holt59 merged commit 495f0d5 into ModOrganizer2:master Jan 2, 2025
2 checks passed
@JonathanFeenstra JonathanFeenstra deleted the nexusdownload-gamename branch January 6, 2025 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants