Skip to content

Commit

Permalink
Switch VersionInfo -> Version for ModOrganizer2. (#2063)
Browse files Browse the repository at this point in the history
  • Loading branch information
Holt59 committed Aug 5, 2024
1 parent 15dab98 commit 948d09f
Show file tree
Hide file tree
Showing 18 changed files with 392 additions and 906 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 6.7.0
modules:
version: 6.7.1
modules: qtpositioning qtwebchannel qtwebengine qtwebsockets
cache: true

- uses: actions/checkout@v4
Expand Down
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
21 changes: 11 additions & 10 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,9 +639,10 @@ MainWindow::~MainWindow()
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));
QString title =
QString("%1 \xe2\x80\x93 Mod Organizer v%2")
.arg(m_OrganizerCore.managedGame()->displayGameName(),
m_OrganizerCore.getVersion().string(Version::FormatCondensed));

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

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

void MainWindow::createEndorseMenu()
Expand Down Expand Up @@ -2163,8 +2165,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 @@ -2967,8 +2970,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 @@ -2989,8 +2991,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 @@ -203,8 +203,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 948d09f

Please sign in to comment.