Skip to content

Commit

Permalink
Switch VersionInfo -> Version for ModOrganizer2.
Browse files Browse the repository at this point in the history
  • Loading branch information
Holt59 committed Jul 20, 2024
1 parent 7724a80 commit 51717ed
Show file tree
Hide file tree
Showing 16 changed files with 251 additions and 201 deletions.
2 changes: 1 addition & 1 deletion src/env.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,7 @@ std::wstring safeVersion()
{
try {
// this can throw
return MOShared::createVersionInfo().displayString(3).toStdWString() + L"-";
return MOShared::createVersionInfo().string().toStdWString() + L"-";
} catch (...) {
return {};
}
Expand Down
15 changes: 7 additions & 8 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ void MainWindow::updateWindowTitle(const APIUserAccount& user)
//"\xe2\x80\x93" is an "em dash", a longer "-"
QString title = QString("%1 \xe2\x80\x93 Mod Organizer v%2")
.arg(m_OrganizerCore.managedGame()->displayGameName(),
m_OrganizerCore.getVersion().displayString(3));
m_OrganizerCore.getVersion().string());

if (!user.name().isEmpty()) {
const QString premium = (user.type() == APIUserAccountTypes::Premium ? "*" : "");
Expand Down Expand Up @@ -1051,7 +1051,7 @@ void MainWindow::checkForProblemsImpl()

void MainWindow::about()
{
AboutDialog(m_OrganizerCore.getVersion().displayString(3), this).exec();
AboutDialog(m_OrganizerCore.getVersion().string(), this).exec();
}

void MainWindow::createEndorseMenu()
Expand Down Expand Up @@ -2175,8 +2175,9 @@ void MainWindow::processUpdates()
auto& settings = m_OrganizerCore.settings();
const auto earliest = QVersionNumber::fromString("2.1.2").normalized();

const auto lastVersion = settings.version().value_or(earliest);
const auto currentVersion = m_OrganizerCore.getVersion().asQVersionNumber();
const auto lastVersion = settings.version().value_or(earliest);
const auto currentVersion =
QVersionNumber::fromString(m_OrganizerCore.getVersion().string()).normalized();

m_LastVersion = lastVersion;

Expand Down Expand Up @@ -2979,8 +2980,7 @@ void MainWindow::actionEndorseMO()
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
NexusInterface::instance().requestToggleEndorsement(
game->gameShortName(), game->nexusModOrganizerID(),
m_OrganizerCore.getVersion().canonicalString(), true, this, QVariant(),
QString());
m_OrganizerCore.getVersion().string(), true, this, QVariant(), QString());
}
}

Expand All @@ -3001,8 +3001,7 @@ void MainWindow::actionWontEndorseMO()
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
NexusInterface::instance().requestToggleEndorsement(
game->gameShortName(), game->nexusModOrganizerID(),
m_OrganizerCore.getVersion().canonicalString(), false, this, QVariant(),
QString());
m_OrganizerCore.getVersion().string(), false, this, QVariant(), QString());
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/moapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ int MOApplication::setup(MOMultiProcess& multiProcess, bool forceSelect)
log::debug("command line: '{}'", QString::fromWCharArray(GetCommandLineW()));

log::info("starting Mod Organizer version {} revision {} in {}, usvfs: {}",
createVersionInfo().displayString(3), GITID,
QCoreApplication::applicationDirPath(), MOShared::getUsvfsVersionString());
createVersionInfo().string(), GITID, QCoreApplication::applicationDirPath(),
MOShared::getUsvfsVersionString());

if (multiProcess.secondary()) {
log::debug("another instance of MO is running but --multiple was given");
Expand Down
2 changes: 1 addition & 1 deletion src/modinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ class ModInfo : public QObject, public MOBase::IModInterface
*
* @note Currently, this changes the color of the cell under the "Notes" column.
*/
virtual void setColor(QColor color) {}
virtual void setColor([[maybe_unused]] QColor color) {}

/**
* @brief Adds the information that a file has been installed into this mod.
Expand Down
3 changes: 1 addition & 2 deletions src/nexusinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,8 @@ NexusInterface::NexusInterface(Settings* s) : m_PluginContainer(nullptr)
g_instance = this;

m_User.limits(defaultAPILimits());
m_MOVersion = createVersionInfo();

m_AccessManager = new NXMAccessManager(this, s, m_MOVersion.displayString(3));
m_AccessManager = new NXMAccessManager(this, s, createVersionInfo().string());

m_DiskCache = new QNetworkDiskCache(this);

Expand Down
1 change: 0 additions & 1 deletion src/nexusinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,6 @@ private slots:
NXMAccessManager* m_AccessManager;
std::list<NXMRequestInfo> m_ActiveRequest;
QQueue<NXMRequestInfo> m_RequestQueue;
MOBase::VersionInfo m_MOVersion;
PluginContainer* m_PluginContainer;
APIUserAccount m_User;
};
Expand Down
Loading

0 comments on commit 51717ed

Please sign in to comment.