From c95039a8fdaefe81d1fa33edfc54bb74c19c259b Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Sun, 5 Dec 2021 03:42:51 -0600 Subject: [PATCH] Changes to compile with Qt6 + Boost 1.77 --- src/handlerwindow.cpp | 2 +- src/main.cpp | 7 ++++--- src/nxmhandler_en.ts | 24 ++++++++++++------------ 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/handlerwindow.cpp b/src/handlerwindow.cpp index b8c8738..5692ac0 100644 --- a/src/handlerwindow.cpp +++ b/src/handlerwindow.cpp @@ -75,7 +75,7 @@ void HandlerWindow::addBinaryDialog() if (QFileInfo(iterItem->text(COL_BINARY)) == QFileInfo(dialog.executable())) { QStringList games = iterItem->text(COL_GAMES).split(","); games.append(dialog.gameIDs()); - games = games.toSet().toList(); + games.removeDuplicates(); iterItem->setText(COL_GAMES, games.join(",")); if (iterItem->text(COL_ARGUMENTS).compare(dialog.arguments(), Qt::CaseInsensitive) != 0) { iterItem->setText(COL_ARGUMENTS, dialog.arguments()); diff --git a/src/main.cpp b/src/main.cpp index 9488058..a491bed 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include "logger.h" @@ -84,7 +85,7 @@ HandlerStorage *loadStorage(bool forceReg) HandlerStorage *storage = nullptr; QDir globalStorage( - QStandardPaths::writableLocation(QStandardPaths::DataLocation)); + QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)); globalStorage.cd("../ModOrganizer"); QDir baseDir; if (globalStorage.exists()) { @@ -158,7 +159,7 @@ HandlerStorage *loadStorage(bool forceReg) static void applyChromeFix() { - QString dataPath = QDir::fromNativeSeparators(QStandardPaths::writableLocation(QStandardPaths::DataLocation)); + QString dataPath = QDir::fromNativeSeparators(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)); QString fileName = QDir(dataPath + "/../google/chrome/user data/local state").canonicalPath(); QFile chromeLocalState(fileName); @@ -241,7 +242,7 @@ int main(int argc, char *argv[]) if (args.count() > 1) { if ((args.at(1) == "reg") || (args.at(1) == "forcereg")) { if (args.count() == 4) { - storage->registerHandler(args.at(2).split(",", QString::SkipEmptyParts), QDir::toNativeSeparators(args.at(3)), "", true, forceReg); + storage->registerHandler(args.at(2).split(",", Qt::SkipEmptyParts), QDir::toNativeSeparators(args.at(3)), "", true, forceReg); if (forceReg) { applyChromeFix(); } diff --git a/src/nxmhandler_en.ts b/src/nxmhandler_en.ts index 8b11545..ee895e4 100644 --- a/src/nxmhandler_en.ts +++ b/src/nxmhandler_en.ts @@ -128,60 +128,60 @@ Use this if you moved Mod Organizer or if you uninstalled the Mod Organizer inst QObject - + Change Handler? - + A nxm handler from a different Mod Organizer installation has been registered. Do you want to replace it? This is usually not necessary unless the other installation is defective. - + Register? - + Mod Organizer is not set up to handle nxm links. Associate it with nxm links? - + No, don't ask again - + Error - - + + Invalid number of parameters - + No handler found - + No application registered to handle this game (%1). If you expected Mod Organizer to handle the link, you have to go to Settings->Nexus and click the "Associate with ... links"-button. If you have NMM installed, you can re-register it for nxm-links so it handles the links that MO doesn't. - + Invalid Arguments - + Uncaught exception: %1