diff options
Diffstat (limited to 'libs')
40 files changed, 323 insertions, 152 deletions
diff --git a/libs/bsatk/src/bsafolder.cpp b/libs/bsatk/src/bsafolder.cpp index 21e2611..7cb5f88 100644 --- a/libs/bsatk/src/bsafolder.cpp +++ b/libs/bsatk/src/bsafolder.cpp @@ -139,6 +139,19 @@ std::string Folder::getFullPath() const void Folder::addFolderInt(Folder::Ptr folder) { std::filesystem::path path(folder->m_Name); + if (path.empty()) { + folder->m_Parent = this; + if (m_SubFoldersByName.contains("")) { + m_SubFoldersByName.at("")->m_Files.insert(m_SubFoldersByName.at("")->m_Files.end(), + folder->m_Files.begin(), + folder->m_Files.end()); + return; + } + m_SubFolders.push_back(folder); + m_SubFoldersByName[""] = folder; + return; + } + auto it = path.begin(); std::string firstStr = it->string(); std::filesystem::path remaining; @@ -174,6 +187,16 @@ void Folder::addFolderInt(Folder::Ptr folder) Folder::Ptr Folder::addOrFindFolderInt(Folder* folder) { std::filesystem::path path(folder->m_Name); + if (path.empty()) { + if (m_SubFoldersByName.contains("")) { + return m_SubFoldersByName.at(""); + } + folder->m_Parent = this; + m_SubFolders.push_back(Folder::Ptr(folder)); + m_SubFoldersByName[""] = m_SubFolders.back(); + return m_SubFolders.back(); + } + auto it = path.begin(); std::string firstStr = it->string(); std::filesystem::path remaining; diff --git a/libs/game_bethesda/src/gamebryo/gamegamebryo.cpp b/libs/game_bethesda/src/gamebryo/gamegamebryo.cpp index 1bcc2c0..cc561b6 100644 --- a/libs/game_bethesda/src/gamebryo/gamegamebryo.cpp +++ b/libs/game_bethesda/src/gamebryo/gamegamebryo.cpp @@ -309,6 +309,34 @@ bool GameGamebryo::prepareIni(const QString&) return true; } +#ifndef _WIN32 +// Ensure both the canonical (proper-case) and lowercase versions of an INI file +// exist in a directory. One will be the real file, the other a symlink. +// This prevents case-sensitivity issues on Linux where different code paths or +// the game itself may reference either casing. +static void ensureCaseAliases(const QDir& dir, const QString& canonicalName, + const QString& actualFileName) +{ + QString lowerName = canonicalName.toLower(); + + auto ensureAlias = [&](const QString& aliasName) { + if (aliasName != actualFileName) { + QString aliasPath = dir.absoluteFilePath(aliasName); + if (!QFileInfo::exists(aliasPath)) { + QFile::link(actualFileName, aliasPath); + } + } + }; + + // Ensure the canonical (proper-case) name exists + ensureAlias(canonicalName); + // Ensure the lowercase name exists + if (lowerName != canonicalName) { + ensureAlias(lowerName); + } +} +#endif + void GameGamebryo::ensureIniFilesExist(const QString& basePath) { // Make sure the target directory exists @@ -347,16 +375,25 @@ void GameGamebryo::ensureIniFilesExist(const QString& basePath) } // If a differently-cased version exists with adequate content, - // replace the stub (if any) with a symlink to the real file. + // replace the stub (if any) with a copy of the real file. if (!caseMismatchPath.isEmpty()) { QFileInfo altInfo(caseMismatchPath); if (altInfo.exists() && altInfo.size() > 200) { if (targetInfo.exists()) { QFile::remove(targetPath); } - QFile::link(altInfo.fileName(), targetPath); - MOBase::log::info("Created case-matching symlink '{}' -> '{}'", - iniFile, altInfo.fileName()); + if (QFile::copy(altInfo.absoluteFilePath(), targetPath)) { + QFile::setPermissions( + targetPath, + QFile::permissions(targetPath) | QFile::WriteUser | QFile::WriteOwner); + MOBase::log::info("Copied case-mismatched INI '{}' -> '{}'", + altInfo.fileName(), iniFile); + } else { + MOBase::log::warn("Failed to copy case-mismatched INI '{}' -> '{}'", + altInfo.fileName(), iniFile); + } + // Ensure both proper-case and lowercase aliases exist + ensureCaseAliases(baseDir, iniFile, targetInfo.fileName()); continue; } } @@ -364,8 +401,8 @@ void GameGamebryo::ensureIniFilesExist(const QString& basePath) // The INI doesn't exist or is a stub, and no adequate differently-cased // version was found. Try to seed from the game's default INI template - // (e.g., fallout_default.ini, oblivion_default.ini). - QString baseName = QFileInfo(iniFile).completeBaseName(); // "fallout" + // (e.g., Fallout_default.ini, Oblivion_default.ini). + QString baseName = QFileInfo(iniFile).completeBaseName(); QString defaultIniName = baseName + "_default.ini"; QString defaultIniPath = resolveFileCaseInsensitive(gameDirectory().absoluteFilePath(defaultIniName)); @@ -386,6 +423,16 @@ void GameGamebryo::ensureIniFilesExist(const QString& basePath) defaultIniPath, targetPath); } } + +#ifndef _WIN32 + // After creating/finding the INI, ensure both proper-case and lowercase + // versions exist so that any code path or the game itself can find it + // regardless of which casing it uses. + QFileInfo finalInfo(targetPath); + if (finalInfo.exists() || finalInfo.isSymLink()) { + ensureCaseAliases(baseDir, iniFile, finalInfo.fileName()); + } +#endif } } @@ -468,6 +515,36 @@ QString GameGamebryo::localAppFolder() } return result; #else + // On Linux, AppData/Local lives inside the Wine prefix. + const QString configuredPrefix = + QSettings().value("fluorine/prefix_path").toString().trimmed(); + if (!configuredPrefix.isEmpty()) { + const QString appDataLocal = + QDir(configuredPrefix).filePath("drive_c/users/steamuser/AppData/Local"); + if (QDir(appDataLocal).exists() || QDir().mkpath(appDataLocal)) { + return appDataLocal; + } + } + + // Fallback: search Steam Proton prefixes + const QString steamRoot = + QDir::homePath() + "/.steam/steam/steamapps/compatdata"; + QDir compatDir(steamRoot); + if (compatDir.exists()) { + for (const QString& appId : + compatDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot)) { + const QString appDataLocal = steamRoot + "/" + appId + + "/pfx/drive_c/users/steamuser/AppData/Local"; + if (QDir(appDataLocal).exists()) { + return appDataLocal; + } + } + } + + // Last resort: GenericDataLocation (won't work for Wine games but + // prevents crashes) + MOBase::log::warn("localAppFolder: could not find Wine prefix " + "AppData/Local, falling back to XDG data location"); return QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation); #endif } @@ -502,6 +579,32 @@ void GameGamebryo::copyToProfile(QString const& sourcePath, } } } + +#ifndef _WIN32 + // Ensure both proper-case and lowercase versions exist (one as symlink) + QFileInfo actualFile(filePath); + if (actualFile.exists() || actualFile.isSymLink()) { + ensureCaseAliases(destinationDirectory, destinationFileName, + actualFile.fileName()); + } +#endif +} + +QString GameGamebryo::localAppName() const +{ + // Default: derive from the My Games path. If myGamesPath() is + // e.g. ".../Documents/My Games/Skyrim Special Edition", we return + // "Skyrim Special Edition". This matches the AppData/Local subfolder + // for the vast majority of Bethesda games. + const QString mgp = myGamesPath(); + if (!mgp.isEmpty()) { + const QString leaf = QDir(mgp).dirName(); + if (!leaf.isEmpty() && leaf != QStringLiteral(".")) { + return leaf; + } + } + // Fallback: gameShortName is used by the base mappings() + return gameShortName(); } MappingType GameGamebryo::mappings() const @@ -510,7 +613,7 @@ MappingType GameGamebryo::mappings() const for (const QString& profileFile : {"plugins.txt", "loadorder.txt"}) { result.push_back({m_Organizer->profilePath() + "/" + profileFile, - localAppFolder() + "/" + gameShortName() + "/" + profileFile, + localAppFolder() + "/" + localAppName() + "/" + profileFile, false}); } diff --git a/libs/game_bethesda/src/gamebryo/gamegamebryo.h b/libs/game_bethesda/src/gamebryo/gamegamebryo.h index fa0a13d..78ac1d4 100644 --- a/libs/game_bethesda/src/gamebryo/gamegamebryo.h +++ b/libs/game_bethesda/src/gamebryo/gamegamebryo.h @@ -90,6 +90,13 @@ public: // IPluginFileMapper interface public: // Other (e.g. for game features) QString myGamesPath() const; + // Returns the folder name used by the game under AppData/Local + // (e.g. "FalloutNV", "Skyrim Special Edition"). Defaults to the + // My Games subfolder name. Override in games where these differ + // (e.g. Enderal uses lowercase "enderal" in AppData but "Enderal" + // in My Games). + virtual QString localAppName() const; + protected: // Retrieve the saves extension for the game. virtual QString savegameExtension() const = 0; diff --git a/libs/game_bethesda/src/games/enderal/enderalbsainvalidation.cpp b/libs/game_bethesda/src/games/enderal/enderalbsainvalidation.cpp index 5564075..8fb10c6 100644 --- a/libs/game_bethesda/src/games/enderal/enderalbsainvalidation.cpp +++ b/libs/game_bethesda/src/games/enderal/enderalbsainvalidation.cpp @@ -2,7 +2,7 @@ EnderalBSAInvalidation::EnderalBSAInvalidation(MOBase::DataArchives* dataArchives, MOBase::IPluginGame const* game) - : GamebryoBSAInvalidation(dataArchives, "enderal.ini", game) + : GamebryoBSAInvalidation(dataArchives, "Enderal.ini", game) {} QString EnderalBSAInvalidation::invalidationBSAName() const diff --git a/libs/game_bethesda/src/games/enderal/enderaldataarchives.cpp b/libs/game_bethesda/src/games/enderal/enderaldataarchives.cpp index 3ac4ee0..1a7e22c 100644 --- a/libs/game_bethesda/src/games/enderal/enderaldataarchives.cpp +++ b/libs/game_bethesda/src/games/enderal/enderaldataarchives.cpp @@ -16,8 +16,8 @@ QStringList EnderalDataArchives::archives(const MOBase::IProfile* profile) const QStringList result; QString iniFile = profile->localSettingsEnabled() - ? QDir(profile->absolutePath()).absoluteFilePath("enderal.ini") - : localGameDirectory().absoluteFilePath("enderal.ini"); + ? QDir(profile->absolutePath()).absoluteFilePath("Enderal.ini") + : localGameDirectory().absoluteFilePath("Enderal.ini"); result.append(getArchivesFromKey(iniFile, "SResourceArchiveList")); result.append(getArchivesFromKey(iniFile, "SResourceArchiveList2")); @@ -30,8 +30,8 @@ void EnderalDataArchives::writeArchiveList(MOBase::IProfile* profile, QString list = before.join(", "); QString iniFile = profile->localSettingsEnabled() - ? QDir(profile->absolutePath()).absoluteFilePath("enderal.ini") - : localGameDirectory().absoluteFilePath("enderal.ini"); + ? QDir(profile->absolutePath()).absoluteFilePath("Enderal.ini") + : localGameDirectory().absoluteFilePath("Enderal.ini"); if (list.length() > 255) { int splitIdx = list.lastIndexOf(",", 256); setArchivesToKey(iniFile, "SResourceArchiveList", list.mid(0, splitIdx)); diff --git a/libs/game_bethesda/src/games/enderal/gameenderal.cpp b/libs/game_bethesda/src/games/enderal/gameenderal.cpp index fb4e1d7..959d545 100644 --- a/libs/game_bethesda/src/games/enderal/gameenderal.cpp +++ b/libs/game_bethesda/src/games/enderal/gameenderal.cpp @@ -51,7 +51,7 @@ bool GameEnderal::init(IOrganizer* moInfo) registerFeature(dataArchives); registerFeature(std::make_shared<EnderalBSAInvalidation>(dataArchives.get(), this)); registerFeature(std::make_shared<GamebryoSaveGameInfo>(this)); - registerFeature(std::make_shared<EnderalLocalSavegames>(this, "enderal.ini")); + registerFeature(std::make_shared<EnderalLocalSavegames>(this, "Enderal.ini")); registerFeature(std::make_shared<EnderalModDataChecker>(this)); registerFeature(std::make_shared<EnderalModDataContent>(moInfo->gameFeatures())); registerFeature(std::make_shared<EnderalGamePlugins>(moInfo)); @@ -126,16 +126,16 @@ void GameEnderal::initializeProfile(const QDir& path, ProfileSettings settings) if (settings.testFlag(IPluginGame::CONFIGURATION)) { if (settings.testFlag(IPluginGame::PREFER_DEFAULTS) || - !QFileInfo(myGamesPath() + "/enderal.ini").exists()) { + !QFileInfo(myGamesPath() + "/Enderal.ini").exists()) { // there is no default ini, actually they are going to put them in for us! - copyToProfile(gameDirectory().absolutePath(), path, "enderal_default.ini", - "enderal.ini"); - copyToProfile(gameDirectory().absolutePath(), path, "enderalprefs_default.ini", - "enderalprefs.ini"); + copyToProfile(gameDirectory().absolutePath(), path, "Enderal_default.ini", + "Enderal.ini"); + copyToProfile(gameDirectory().absolutePath(), path, "EnderalPrefs_default.ini", + "EnderalPrefs.ini"); } else { - copyToProfile(myGamesPath(), path, "enderal.ini"); - copyToProfile(myGamesPath(), path, "enderalprefs.ini"); + copyToProfile(myGamesPath(), path, "Enderal.ini"); + copyToProfile(myGamesPath(), path, "EnderalPrefs.ini"); } } } @@ -193,6 +193,12 @@ QString GameEnderal::gameShortName() const return "Enderal"; } +QString GameEnderal::localAppName() const +{ + // Enderal uses lowercase "enderal" in AppData/Local + return "enderal"; +} + QString GameEnderal::gameNexusName() const { return "enderal"; @@ -215,7 +221,7 @@ QStringList GameEnderal::validShortNames() const QStringList GameEnderal::iniFiles() const { - return {"enderal.ini", "enderalprefs.ini"}; + return {"Enderal.ini", "EnderalPrefs.ini"}; } QStringList GameEnderal::DLCPlugins() const diff --git a/libs/game_bethesda/src/games/enderal/gameenderal.h b/libs/game_bethesda/src/games/enderal/gameenderal.h index fb0a377..78b8f72 100644 --- a/libs/game_bethesda/src/games/enderal/gameenderal.h +++ b/libs/game_bethesda/src/games/enderal/gameenderal.h @@ -30,6 +30,7 @@ public: // IPluginGame interface virtual QString binaryName() const override; virtual QString getLauncherName() const override; virtual QString gameShortName() const override; + virtual QString localAppName() const override; virtual QStringList validShortNames() const override; virtual QString gameNexusName() const override; virtual QStringList primarySources() const override; diff --git a/libs/game_bethesda/src/games/fallout3/fallout3bsainvalidation.cpp b/libs/game_bethesda/src/games/fallout3/fallout3bsainvalidation.cpp index ce981fb..43c8733 100644 --- a/libs/game_bethesda/src/games/fallout3/fallout3bsainvalidation.cpp +++ b/libs/game_bethesda/src/games/fallout3/fallout3bsainvalidation.cpp @@ -2,7 +2,7 @@ Fallout3BSAInvalidation::Fallout3BSAInvalidation(MOBase::DataArchives* dataArchives, MOBase::IPluginGame const* game) - : GamebryoBSAInvalidation(dataArchives, "fallout.ini", game) + : GamebryoBSAInvalidation(dataArchives, "Fallout.ini", game) {} QString Fallout3BSAInvalidation::invalidationBSAName() const diff --git a/libs/game_bethesda/src/games/fallout3/fallout3dataarchives.cpp b/libs/game_bethesda/src/games/fallout3/fallout3dataarchives.cpp index ed6627b..167cce5 100644 --- a/libs/game_bethesda/src/games/fallout3/fallout3dataarchives.cpp +++ b/libs/game_bethesda/src/games/fallout3/fallout3dataarchives.cpp @@ -14,8 +14,8 @@ QStringList Fallout3DataArchives::archives(const MOBase::IProfile* profile) cons QStringList result; QString iniFile = profile->localSettingsEnabled() - ? QDir(profile->absolutePath()).absoluteFilePath("fallout.ini") - : localGameDirectory().absoluteFilePath("fallout.ini"); + ? QDir(profile->absolutePath()).absoluteFilePath("Fallout.ini") + : localGameDirectory().absoluteFilePath("Fallout.ini"); result.append(getArchivesFromKey(iniFile, "SArchiveList")); return result; @@ -27,7 +27,7 @@ void Fallout3DataArchives::writeArchiveList(MOBase::IProfile* profile, QString list = before.join(", "); QString iniFile = profile->localSettingsEnabled() - ? QDir(profile->absolutePath()).absoluteFilePath("fallout.ini") - : localGameDirectory().absoluteFilePath("fallout.ini"); + ? QDir(profile->absolutePath()).absoluteFilePath("Fallout.ini") + : localGameDirectory().absoluteFilePath("Fallout.ini"); setArchivesToKey(iniFile, "SArchiveList", list); } diff --git a/libs/game_bethesda/src/games/fallout3/gamefallout3.cpp b/libs/game_bethesda/src/games/fallout3/gamefallout3.cpp index f2f4562..75e1ea3 100644 --- a/libs/game_bethesda/src/games/fallout3/gamefallout3.cpp +++ b/libs/game_bethesda/src/games/fallout3/gamefallout3.cpp @@ -40,7 +40,7 @@ bool GameFallout3::init(IOrganizer* moInfo) registerFeature(dataArchives); registerFeature(std::make_shared<Fallout3BSAInvalidation>(dataArchives.get(), this)); registerFeature(std::make_shared<GamebryoSaveGameInfo>(this)); - registerFeature(std::make_shared<GamebryoLocalSavegames>(this, "fallout.ini")); + registerFeature(std::make_shared<GamebryoLocalSavegames>(this, "Fallout.ini")); registerFeature(std::make_shared<Fallout3ModDataChecker>(this)); registerFeature( std::make_shared<Fallout3ModDataContent>(m_Organizer->gameFeatures())); @@ -167,14 +167,14 @@ void GameFallout3::initializeProfile(const QDir& path, ProfileSettings settings) if (settings.testFlag(IPluginGame::CONFIGURATION)) { if (settings.testFlag(IPluginGame::PREFER_DEFAULTS) || - !QFileInfo(myGamesPath(), "fallout.ini").exists()) { - copyToProfile(gameDirectory().absolutePath(), path, "fallout_default.ini", - "fallout.ini"); + !QFileInfo(myGamesPath(), "Fallout.ini").exists()) { + copyToProfile(gameDirectory().absolutePath(), path, "Fallout_default.ini", + "Fallout.ini"); } else { - copyToProfile(myGamesPath(), path, "fallout.ini"); + copyToProfile(myGamesPath(), path, "Fallout.ini"); } - copyToProfile(myGamesPath(), path, "falloutprefs.ini"); + copyToProfile(myGamesPath(), path, "FalloutPrefs.ini"); copyToProfile(myGamesPath(), path, "FalloutCustom.ini"); copyToProfile(myGamesPath(), path, "custom.ini"); copyToProfile(myGamesPath(), path, "GECKCustom.ini"); @@ -246,7 +246,7 @@ QString GameFallout3::gameNexusName() const QStringList GameFallout3::iniFiles() const { - return {"fallout.ini", "falloutprefs.ini", "FalloutCustom.ini", "GECKCustom.ini", + return {"Fallout.ini", "FalloutPrefs.ini", "FalloutCustom.ini", "GECKCustom.ini", "GECKPrefs.ini"}; } diff --git a/libs/game_bethesda/src/games/fallout4/fallout4dataarchives.cpp b/libs/game_bethesda/src/games/fallout4/fallout4dataarchives.cpp index c0931ce..035b771 100644 --- a/libs/game_bethesda/src/games/fallout4/fallout4dataarchives.cpp +++ b/libs/game_bethesda/src/games/fallout4/fallout4dataarchives.cpp @@ -22,8 +22,8 @@ QStringList Fallout4DataArchives::archives(const MOBase::IProfile* profile) cons QStringList result; QString iniFile = profile->localSettingsEnabled() - ? QDir(profile->absolutePath()).absoluteFilePath("fallout4.ini") - : localGameDirectory().absoluteFilePath("fallout4.ini"); + ? QDir(profile->absolutePath()).absoluteFilePath("Fallout4.ini") + : localGameDirectory().absoluteFilePath("Fallout4.ini"); result.append(getArchivesFromKey(iniFile, "SResourceArchiveList")); result.append(getArchivesFromKey(iniFile, "SResourceArchiveList2")); @@ -36,8 +36,8 @@ void Fallout4DataArchives::writeArchiveList(MOBase::IProfile* profile, QString list = before.join(", "); QString iniFile = profile->localSettingsEnabled() - ? QDir(profile->absolutePath()).absoluteFilePath("fallout4.ini") - : localGameDirectory().absoluteFilePath("fallout4.ini"); + ? QDir(profile->absolutePath()).absoluteFilePath("Fallout4.ini") + : localGameDirectory().absoluteFilePath("Fallout4.ini"); if (list.length() > 255) { int splitIdx = list.lastIndexOf(",", 256); setArchivesToKey(iniFile, "SResourceArchiveList", list.mid(0, splitIdx)); diff --git a/libs/game_bethesda/src/games/fallout4/gamefallout4.cpp b/libs/game_bethesda/src/games/fallout4/gamefallout4.cpp index 8939a3c..02d30cb 100644 --- a/libs/game_bethesda/src/games/fallout4/gamefallout4.cpp +++ b/libs/game_bethesda/src/games/fallout4/gamefallout4.cpp @@ -43,7 +43,7 @@ bool GameFallout4::init(IOrganizer* moInfo) registerFeature(std::make_shared<Fallout4ScriptExtender>(this)); registerFeature(dataArchives); - registerFeature(std::make_shared<GamebryoLocalSavegames>(this, "fallout4custom.ini")); + registerFeature(std::make_shared<GamebryoLocalSavegames>(this, "Fallout4Custom.ini")); registerFeature(std::make_shared<Fallout4ModDataChecker>(this)); registerFeature( std::make_shared<Fallout4ModDataContent>(m_Organizer->gameFeatures())); @@ -139,15 +139,15 @@ void GameFallout4::initializeProfile(const QDir& path, ProfileSettings settings) if (settings.testFlag(IPluginGame::CONFIGURATION)) { if (settings.testFlag(IPluginGame::PREFER_DEFAULTS) || - !QFileInfo(myGamesPath() + "/fallout4.ini").exists()) { - copyToProfile(gameDirectory().absolutePath(), path, "fallout4_default.ini", - "fallout4.ini"); + !QFileInfo(myGamesPath() + "/Fallout4.ini").exists()) { + copyToProfile(gameDirectory().absolutePath(), path, "Fallout4_default.ini", + "Fallout4.ini"); } else { - copyToProfile(myGamesPath(), path, "fallout4.ini"); + copyToProfile(myGamesPath(), path, "Fallout4.ini"); } - copyToProfile(myGamesPath(), path, "fallout4prefs.ini"); - copyToProfile(myGamesPath(), path, "fallout4custom.ini"); + copyToProfile(myGamesPath(), path, "Fallout4Prefs.ini"); + copyToProfile(myGamesPath(), path, "Fallout4Custom.ini"); } } @@ -226,7 +226,7 @@ QString GameFallout4::gameNexusName() const QStringList GameFallout4::iniFiles() const { - return {"fallout4.ini", "fallout4prefs.ini", "fallout4custom.ini"}; + return {"Fallout4.ini", "Fallout4Prefs.ini", "Fallout4Custom.ini"}; } QStringList GameFallout4::DLCPlugins() const diff --git a/libs/game_bethesda/src/games/fallout4london/fo4londondataarchives.cpp b/libs/game_bethesda/src/games/fallout4london/fo4londondataarchives.cpp index e631f75..6d08e86 100644 --- a/libs/game_bethesda/src/games/fallout4london/fo4londondataarchives.cpp +++ b/libs/game_bethesda/src/games/fallout4london/fo4londondataarchives.cpp @@ -22,8 +22,8 @@ QStringList Fallout4LondonDataArchives::archives(const MOBase::IProfile* profile QStringList result; QString iniFile = profile->localSettingsEnabled() - ? QDir(profile->absolutePath()).absoluteFilePath("fallout4.ini") - : localGameDirectory().absoluteFilePath("fallout4.ini"); + ? QDir(profile->absolutePath()).absoluteFilePath("Fallout4.ini") + : localGameDirectory().absoluteFilePath("Fallout4.ini"); result.append(getArchivesFromKey(iniFile, "SResourceArchiveList")); result.append(getArchivesFromKey(iniFile, "SResourceArchiveList2")); @@ -36,8 +36,8 @@ void Fallout4LondonDataArchives::writeArchiveList(MOBase::IProfile* profile, QString list = before.join(", "); QString iniFile = profile->localSettingsEnabled() - ? QDir(profile->absolutePath()).absoluteFilePath("fallout4.ini") - : localGameDirectory().absoluteFilePath("fallout4.ini"); + ? QDir(profile->absolutePath()).absoluteFilePath("Fallout4.ini") + : localGameDirectory().absoluteFilePath("Fallout4.ini"); if (list.length() > 255) { int splitIdx = list.lastIndexOf(",", 256); setArchivesToKey(iniFile, "SResourceArchiveList", list.mid(0, splitIdx)); diff --git a/libs/game_bethesda/src/games/fallout4london/gamefo4london.cpp b/libs/game_bethesda/src/games/fallout4london/gamefo4london.cpp index 0fa774a..646bf1c 100644 --- a/libs/game_bethesda/src/games/fallout4london/gamefo4london.cpp +++ b/libs/game_bethesda/src/games/fallout4london/gamefo4london.cpp @@ -151,15 +151,15 @@ void GameFallout4London::initializeProfile(const QDir& path, if (settings.testFlag(IPluginGame::CONFIGURATION)) { if (settings.testFlag(IPluginGame::PREFER_DEFAULTS) || - !QFileInfo(myGamesPath() + "/fallout4.ini").exists()) { - copyToProfile(gameDirectory().absolutePath(), path, "fallout4_default.ini", - "fallout4.ini"); + !QFileInfo(myGamesPath() + "/Fallout4.ini").exists()) { + copyToProfile(gameDirectory().absolutePath(), path, "Fallout4_default.ini", + "Fallout4.ini"); } else { - copyToProfile(myGamesPath(), path, "fallout4.ini"); + copyToProfile(myGamesPath(), path, "Fallout4.ini"); } - copyToProfile(myGamesPath(), path, "fallout4prefs.ini"); - copyToProfile(myGamesPath(), path, "fallout4custom.ini"); + copyToProfile(myGamesPath(), path, "Fallout4Prefs.ini"); + copyToProfile(myGamesPath(), path, "Fallout4Custom.ini"); } } @@ -258,7 +258,7 @@ QString GameFallout4London::getLauncherName() const QStringList GameFallout4London::iniFiles() const { - return {"fallout4.ini", "fallout4prefs.ini", "fallout4custom.ini"}; + return {"Fallout4.ini", "Fallout4Prefs.ini", "Fallout4Custom.ini"}; } QStringList GameFallout4London::DLCPlugins() const diff --git a/libs/game_bethesda/src/games/fallout4vr/fallout4vrdataarchives.cpp b/libs/game_bethesda/src/games/fallout4vr/fallout4vrdataarchives.cpp index 58a9a09..366724f 100644 --- a/libs/game_bethesda/src/games/fallout4vr/fallout4vrdataarchives.cpp +++ b/libs/game_bethesda/src/games/fallout4vr/fallout4vrdataarchives.cpp @@ -23,8 +23,8 @@ QStringList Fallout4VRDataArchives::archives(const MOBase::IProfile* profile) co QStringList result; QString iniFile = profile->localSettingsEnabled() - ? QDir(profile->absolutePath()).absoluteFilePath("fallout4.ini") - : localGameDirectory().absoluteFilePath("fallout4.ini"); + ? QDir(profile->absolutePath()).absoluteFilePath("Fallout4.ini") + : localGameDirectory().absoluteFilePath("Fallout4.ini"); result.append(getArchivesFromKey(iniFile, "SResourceArchiveList")); result.append(getArchivesFromKey(iniFile, "SResourceArchiveList2")); @@ -37,8 +37,8 @@ void Fallout4VRDataArchives::writeArchiveList(MOBase::IProfile* profile, QString list = before.join(", "); QString iniFile = profile->localSettingsEnabled() - ? QDir(profile->absolutePath()).absoluteFilePath("fallout4.ini") - : localGameDirectory().absoluteFilePath("fallout4.ini"); + ? QDir(profile->absolutePath()).absoluteFilePath("Fallout4.ini") + : localGameDirectory().absoluteFilePath("Fallout4.ini"); if (list.length() > 255) { int splitIdx = list.lastIndexOf(",", 256); setArchivesToKey(iniFile, "SResourceArchiveList", list.mid(0, splitIdx)); diff --git a/libs/game_bethesda/src/games/fallout4vr/gamefallout4vr.cpp b/libs/game_bethesda/src/games/fallout4vr/gamefallout4vr.cpp index bd2448b..852bf7d 100644 --- a/libs/game_bethesda/src/games/fallout4vr/gamefallout4vr.cpp +++ b/libs/game_bethesda/src/games/fallout4vr/gamefallout4vr.cpp @@ -36,7 +36,7 @@ bool GameFallout4VR::init(IOrganizer* moInfo) } registerFeature(std::make_shared<Fallout4VRDataArchives>(this)); - registerFeature(std::make_shared<GamebryoLocalSavegames>(this, "fallout4custom.ini")); + registerFeature(std::make_shared<GamebryoLocalSavegames>(this, "Fallout4Custom.ini")); registerFeature(std::make_shared<Fallout4VRModDataChecker>(this)); registerFeature( std::make_shared<Fallout4VRModDataContent>(m_Organizer->gameFeatures())); @@ -112,14 +112,14 @@ void GameFallout4VR::initializeProfile(const QDir& path, ProfileSettings setting if (settings.testFlag(IPluginGame::CONFIGURATION)) { if (settings.testFlag(IPluginGame::PREFER_DEFAULTS) || - !QFileInfo(myGamesPath() + "/fallout4.ini").exists()) { - copyToProfile(gameDirectory().absolutePath(), path, "fallout4.ini"); + !QFileInfo(myGamesPath() + "/Fallout4.ini").exists()) { + copyToProfile(gameDirectory().absolutePath(), path, "Fallout4.ini"); } else { - copyToProfile(myGamesPath(), path, "fallout4.ini"); + copyToProfile(myGamesPath(), path, "Fallout4.ini"); } - copyToProfile(myGamesPath(), path, "fallout4prefs.ini"); - copyToProfile(myGamesPath(), path, "fallout4custom.ini"); + copyToProfile(myGamesPath(), path, "Fallout4Prefs.ini"); + copyToProfile(myGamesPath(), path, "Fallout4Custom.ini"); } } @@ -175,7 +175,7 @@ QString GameFallout4VR::gameNexusName() const QStringList GameFallout4VR::iniFiles() const { - return {"fallout4.ini", "fallout4custom.ini", "fallout4prefs.ini"}; + return {"Fallout4.ini", "Fallout4Custom.ini", "Fallout4Prefs.ini"}; } QStringList GameFallout4VR::DLCPlugins() const diff --git a/libs/game_bethesda/src/games/falloutnv/falloutnvbsainvalidation.cpp b/libs/game_bethesda/src/games/falloutnv/falloutnvbsainvalidation.cpp index d66591f..2792811 100644 --- a/libs/game_bethesda/src/games/falloutnv/falloutnvbsainvalidation.cpp +++ b/libs/game_bethesda/src/games/falloutnv/falloutnvbsainvalidation.cpp @@ -2,7 +2,7 @@ FalloutNVBSAInvalidation::FalloutNVBSAInvalidation(MOBase::DataArchives* dataArchives, MOBase::IPluginGame const* game) - : GamebryoBSAInvalidation(dataArchives, "fallout.ini", game) + : GamebryoBSAInvalidation(dataArchives, "Fallout.ini", game) {} QString FalloutNVBSAInvalidation::invalidationBSAName() const diff --git a/libs/game_bethesda/src/games/falloutnv/falloutnvdataarchives.cpp b/libs/game_bethesda/src/games/falloutnv/falloutnvdataarchives.cpp index 7314561..008d551 100644 --- a/libs/game_bethesda/src/games/falloutnv/falloutnvdataarchives.cpp +++ b/libs/game_bethesda/src/games/falloutnv/falloutnvdataarchives.cpp @@ -12,8 +12,8 @@ QStringList FalloutNVDataArchives::archives(const MOBase::IProfile* profile) con QStringList result; QString iniFile = profile->localSettingsEnabled() - ? QDir(profile->absolutePath()).absoluteFilePath("fallout.ini") - : localGameDirectory().absoluteFilePath("fallout.ini"); + ? QDir(profile->absolutePath()).absoluteFilePath("Fallout.ini") + : localGameDirectory().absoluteFilePath("Fallout.ini"); result.append(getArchivesFromKey(iniFile, "SArchiveList", 8192)); // NVAC expands the maximum string limit @@ -26,7 +26,7 @@ void FalloutNVDataArchives::writeArchiveList(MOBase::IProfile* profile, QString list = before.join(", "); QString iniFile = profile->localSettingsEnabled() - ? QDir(profile->absolutePath()).absoluteFilePath("fallout.ini") - : localGameDirectory().absoluteFilePath("fallout.ini"); + ? QDir(profile->absolutePath()).absoluteFilePath("Fallout.ini") + : localGameDirectory().absoluteFilePath("Fallout.ini"); setArchivesToKey(iniFile, "SArchiveList", list); } diff --git a/libs/game_bethesda/src/games/falloutnv/gamefalloutnv.cpp b/libs/game_bethesda/src/games/falloutnv/gamefalloutnv.cpp index 1e8e9e9..effc806 100644 --- a/libs/game_bethesda/src/games/falloutnv/gamefalloutnv.cpp +++ b/libs/game_bethesda/src/games/falloutnv/gamefalloutnv.cpp @@ -40,7 +40,7 @@ bool GameFalloutNV::init(IOrganizer* moInfo) registerFeature(dataArchives); registerFeature(std::make_shared<FalloutNVBSAInvalidation>(dataArchives.get(), this)); registerFeature(std::make_shared<GamebryoSaveGameInfo>(this)); - registerFeature(std::make_shared<GamebryoLocalSavegames>(this, "fallout.ini")); + registerFeature(std::make_shared<GamebryoLocalSavegames>(this, "Fallout.ini")); registerFeature(std::make_shared<FalloutNVModDataChecker>(this)); registerFeature( std::make_shared<FalloutNVModDataContent>(m_Organizer->gameFeatures())); @@ -213,15 +213,15 @@ void GameFalloutNV::initializeProfile(const QDir& path, ProfileSettings settings if (settings.testFlag(IPluginGame::CONFIGURATION)) { if (settings.testFlag(IPluginGame::PREFER_DEFAULTS) || - !QFileInfo(myGamesPath() + "/fallout.ini").exists()) { - copyToProfile(gameDirectory().absolutePath(), path, "fallout_default.ini", - "fallout.ini"); + !QFileInfo(myGamesPath() + "/Fallout.ini").exists()) { + copyToProfile(gameDirectory().absolutePath(), path, "Fallout_default.ini", + "Fallout.ini"); } else { - copyToProfile(myGamesPath(), path, "fallout.ini"); + copyToProfile(myGamesPath(), path, "Fallout.ini"); } - copyToProfile(myGamesPath(), path, "falloutprefs.ini"); - copyToProfile(myGamesPath(), path, "falloutcustom.ini"); + copyToProfile(myGamesPath(), path, "FalloutPrefs.ini"); + copyToProfile(myGamesPath(), path, "FalloutCustom.ini"); copyToProfile(myGamesPath(), path, "GECKCustom.ini"); copyToProfile(myGamesPath(), path, "GECKPrefs.ini"); } @@ -282,7 +282,7 @@ QString GameFalloutNV::gameNexusName() const QStringList GameFalloutNV::iniFiles() const { - return {"fallout.ini", "falloutprefs.ini", "falloutcustom.ini", "GECKCustom.ini", + return {"Fallout.ini", "FalloutPrefs.ini", "FalloutCustom.ini", "GECKCustom.ini", "GECKPrefs.ini"}; } diff --git a/libs/game_bethesda/src/games/morrowind/gamemorrowind.cpp b/libs/game_bethesda/src/games/morrowind/gamemorrowind.cpp index faa3a3b..267d04c 100644 --- a/libs/game_bethesda/src/games/morrowind/gamemorrowind.cpp +++ b/libs/game_bethesda/src/games/morrowind/gamemorrowind.cpp @@ -179,7 +179,7 @@ QString GameMorrowind::gameNexusName() const QStringList GameMorrowind::iniFiles() const { - return {"morrowind.ini"}; + return {"Morrowind.ini"}; } QStringList GameMorrowind::DLCPlugins() const diff --git a/libs/game_bethesda/src/games/morrowind/morrowinddataarchives.cpp b/libs/game_bethesda/src/games/morrowind/morrowinddataarchives.cpp index 57a5944..d0b3093 100644 --- a/libs/game_bethesda/src/games/morrowind/morrowinddataarchives.cpp +++ b/libs/game_bethesda/src/games/morrowind/morrowinddataarchives.cpp @@ -53,8 +53,8 @@ QStringList MorrowindDataArchives::archives(const MOBase::IProfile* profile) con QString iniFile = profile->localSettingsEnabled() - ? QDir(profile->absolutePath()).absoluteFilePath("morrowind.ini") - : gameDirectory().absoluteFilePath("morrowind.ini"); + ? QDir(profile->absolutePath()).absoluteFilePath("Morrowind.ini") + : gameDirectory().absoluteFilePath("Morrowind.ini"); result.append(getArchives(iniFile)); return result; @@ -65,7 +65,7 @@ void MorrowindDataArchives::writeArchiveList(MOBase::IProfile* profile, { QString iniFile = profile->localSettingsEnabled() - ? QDir(profile->absolutePath()).absoluteFilePath("morrowind.ini") - : gameDirectory().absoluteFilePath("morrowind.ini"); + ? QDir(profile->absolutePath()).absoluteFilePath("Morrowind.ini") + : gameDirectory().absoluteFilePath("Morrowind.ini"); setArchives(iniFile, before); } diff --git a/libs/game_bethesda/src/games/nehrim/gamenehrim.cpp b/libs/game_bethesda/src/games/nehrim/gamenehrim.cpp index 2e3c8c5..f74448c 100644 --- a/libs/game_bethesda/src/games/nehrim/gamenehrim.cpp +++ b/libs/game_bethesda/src/games/nehrim/gamenehrim.cpp @@ -112,14 +112,14 @@ void GameNehrim::initializeProfile(const QDir& path, ProfileSettings settings) c if (settings.testFlag(IPluginGame::CONFIGURATION)) { if (settings.testFlag(IPluginGame::PREFER_DEFAULTS) || - !QFileInfo(myGamesPath() + "/oblivion.ini").exists()) { - copyToProfile(gameDirectory().absolutePath(), path, "oblivion_default.ini", - "oblivion.ini"); + !QFileInfo(myGamesPath() + "/Oblivion.ini").exists()) { + copyToProfile(gameDirectory().absolutePath(), path, "Oblivion_default.ini", + "Oblivion.ini"); } else { - copyToProfile(myGamesPath(), path, "oblivion.ini"); + copyToProfile(myGamesPath(), path, "Oblivion.ini"); } - copyToProfile(myGamesPath(), path, "oblivionprefs.ini"); + copyToProfile(myGamesPath(), path, "OblivionPrefs.ini"); } } @@ -153,6 +153,12 @@ QString GameNehrim::gameShortName() const return "Nehrim"; } +QString GameNehrim::localAppName() const +{ + // Nehrim shares Oblivion's AppData/Local folder + return "Oblivion"; +} + QString GameNehrim::gameNexusName() const { return "Nehrim"; @@ -160,7 +166,7 @@ QString GameNehrim::gameNexusName() const QStringList GameNehrim::iniFiles() const { - return {"oblivion.ini", "oblivionprefs.ini"}; + return {"Oblivion.ini", "OblivionPrefs.ini"}; } QStringList GameNehrim::DLCPlugins() const diff --git a/libs/game_bethesda/src/games/nehrim/gamenehrim.h b/libs/game_bethesda/src/games/nehrim/gamenehrim.h index a8af24c..f8f43de 100644 --- a/libs/game_bethesda/src/games/nehrim/gamenehrim.h +++ b/libs/game_bethesda/src/games/nehrim/gamenehrim.h @@ -26,6 +26,7 @@ public: // IPluginGame interface virtual QString steamAPPId() const override; virtual QStringList primaryPlugins() const override; virtual QString gameShortName() const override; + virtual QString localAppName() const override; virtual QString gameNexusName() const override; virtual QStringList iniFiles() const override; virtual QStringList DLCPlugins() const override; diff --git a/libs/game_bethesda/src/games/nehrim/nehrimbsainvalidation.cpp b/libs/game_bethesda/src/games/nehrim/nehrimbsainvalidation.cpp index ac89d54..4893374 100644 --- a/libs/game_bethesda/src/games/nehrim/nehrimbsainvalidation.cpp +++ b/libs/game_bethesda/src/games/nehrim/nehrimbsainvalidation.cpp @@ -2,7 +2,7 @@ NehrimBSAInvalidation::NehrimBSAInvalidation(MOBase::DataArchives* dataArchives, MOBase::IPluginGame const* game) - : GamebryoBSAInvalidation(dataArchives, "oblivion.ini", game) + : GamebryoBSAInvalidation(dataArchives, "Oblivion.ini", game) {} QString NehrimBSAInvalidation::invalidationBSAName() const diff --git a/libs/game_bethesda/src/games/oblivion/gameoblivion.cpp b/libs/game_bethesda/src/games/oblivion/gameoblivion.cpp index 9f7a174..fc7766a 100644 --- a/libs/game_bethesda/src/games/oblivion/gameoblivion.cpp +++ b/libs/game_bethesda/src/games/oblivion/gameoblivion.cpp @@ -113,14 +113,14 @@ void GameOblivion::initializeProfile(const QDir& path, ProfileSettings settings) if (settings.testFlag(IPluginGame::CONFIGURATION)) { if (settings.testFlag(IPluginGame::PREFER_DEFAULTS) || - !QFileInfo(myGamesPath() + "/oblivion.ini").exists()) { - copyToProfile(gameDirectory().absolutePath(), path, "oblivion_default.ini", - "oblivion.ini"); + !QFileInfo(myGamesPath() + "/Oblivion.ini").exists()) { + copyToProfile(gameDirectory().absolutePath(), path, "Oblivion_default.ini", + "Oblivion.ini"); } else { - copyToProfile(myGamesPath(), path, "oblivion.ini"); + copyToProfile(myGamesPath(), path, "Oblivion.ini"); } - copyToProfile(myGamesPath(), path, "oblivionprefs.ini"); + copyToProfile(myGamesPath(), path, "OblivionPrefs.ini"); } } @@ -171,7 +171,7 @@ QString GameOblivion::gameNexusName() const QStringList GameOblivion::iniFiles() const { - return {"oblivion.ini", "oblivionprefs.ini"}; + return {"Oblivion.ini", "OblivionPrefs.ini"}; } QStringList GameOblivion::DLCPlugins() const diff --git a/libs/game_bethesda/src/games/oblivion/oblivionbsainvalidation.cpp b/libs/game_bethesda/src/games/oblivion/oblivionbsainvalidation.cpp index 864d37c..9473fa7 100644 --- a/libs/game_bethesda/src/games/oblivion/oblivionbsainvalidation.cpp +++ b/libs/game_bethesda/src/games/oblivion/oblivionbsainvalidation.cpp @@ -2,7 +2,7 @@ OblivionBSAInvalidation::OblivionBSAInvalidation(MOBase::DataArchives* dataArchives, MOBase::IPluginGame const* game) - : GamebryoBSAInvalidation(dataArchives, "oblivion.ini", game) + : GamebryoBSAInvalidation(dataArchives, "Oblivion.ini", game) {} QString OblivionBSAInvalidation::invalidationBSAName() const diff --git a/libs/game_bethesda/src/games/oblivion/obliviondataarchives.cpp b/libs/game_bethesda/src/games/oblivion/obliviondataarchives.cpp index 47c3dd4..3331cc4 100644 --- a/libs/game_bethesda/src/games/oblivion/obliviondataarchives.cpp +++ b/libs/game_bethesda/src/games/oblivion/obliviondataarchives.cpp @@ -13,8 +13,8 @@ QStringList OblivionDataArchives::archives(const MOBase::IProfile* profile) cons QStringList result; QString iniFile = profile->localSettingsEnabled() - ? QDir(profile->absolutePath()).absoluteFilePath("oblivion.ini") - : localGameDirectory().absoluteFilePath("oblivion.ini"); + ? QDir(profile->absolutePath()).absoluteFilePath("Oblivion.ini") + : localGameDirectory().absoluteFilePath("Oblivion.ini"); result.append(getArchivesFromKey(iniFile, "SArchiveList")); return result; @@ -26,7 +26,7 @@ void OblivionDataArchives::writeArchiveList(MOBase::IProfile* profile, QString list = before.join(", "); QString iniFile = profile->localSettingsEnabled() - ? QDir(profile->absolutePath()).absoluteFilePath("oblivion.ini") - : localGameDirectory().absoluteFilePath("oblivion.ini"); + ? QDir(profile->absolutePath()).absoluteFilePath("Oblivion.ini") + : localGameDirectory().absoluteFilePath("Oblivion.ini"); setArchivesToKey(iniFile, "SArchiveList", list); } diff --git a/libs/game_bethesda/src/games/skyrim/gameskyrim.cpp b/libs/game_bethesda/src/games/skyrim/gameskyrim.cpp index 4a0053e..b2d95ff 100644 --- a/libs/game_bethesda/src/games/skyrim/gameskyrim.cpp +++ b/libs/game_bethesda/src/games/skyrim/gameskyrim.cpp @@ -48,7 +48,7 @@ bool GameSkyrim::init(IOrganizer* moInfo) registerFeature(dataArchives); registerFeature(std::make_shared<SkyrimBSAInvalidation>(dataArchives.get(), this)); registerFeature(std::make_shared<GamebryoSaveGameInfo>(this)); - registerFeature(std::make_shared<GamebryoLocalSavegames>(this, "skyrim.ini")); + registerFeature(std::make_shared<GamebryoLocalSavegames>(this, "Skyrim.ini")); registerFeature(std::make_shared<SkyrimModDataChecker>(this)); registerFeature(std::make_shared<SkyrimModDataContent>(m_Organizer->gameFeatures())); registerFeature(std::make_shared<SkyrimGamePlugins>(moInfo)); @@ -125,14 +125,14 @@ void GameSkyrim::initializeProfile(const QDir& path, ProfileSettings settings) c if (settings.testFlag(IPluginGame::CONFIGURATION)) { if (settings.testFlag(IPluginGame::PREFER_DEFAULTS) || - !QFileInfo(myGamesPath() + "/skyrim.ini").exists()) { - copyToProfile(gameDirectory().absolutePath(), path, "skyrim_default.ini", - "skyrim.ini"); + !QFileInfo(myGamesPath() + "/Skyrim.ini").exists()) { + copyToProfile(gameDirectory().absolutePath(), path, "Skyrim_default.ini", + "Skyrim.ini"); } else { - copyToProfile(myGamesPath(), path, "skyrim.ini"); + copyToProfile(myGamesPath(), path, "Skyrim.ini"); } - copyToProfile(myGamesPath(), path, "skyrimprefs.ini"); + copyToProfile(myGamesPath(), path, "SkyrimPrefs.ini"); } } @@ -187,7 +187,7 @@ QStringList GameSkyrim::validShortNames() const QStringList GameSkyrim::iniFiles() const { - return {"skyrim.ini", "skyrimprefs.ini"}; + return {"Skyrim.ini", "SkyrimPrefs.ini"}; } QStringList GameSkyrim::DLCPlugins() const diff --git a/libs/game_bethesda/src/games/skyrim/skyrimbsainvalidation.cpp b/libs/game_bethesda/src/games/skyrim/skyrimbsainvalidation.cpp index e056f10..a98a94a 100644 --- a/libs/game_bethesda/src/games/skyrim/skyrimbsainvalidation.cpp +++ b/libs/game_bethesda/src/games/skyrim/skyrimbsainvalidation.cpp @@ -2,7 +2,7 @@ SkyrimBSAInvalidation::SkyrimBSAInvalidation(MOBase::DataArchives* dataArchives, MOBase::IPluginGame const* game) - : GamebryoBSAInvalidation(dataArchives, "skyrim.ini", game) + : GamebryoBSAInvalidation(dataArchives, "Skyrim.ini", game) {} QString SkyrimBSAInvalidation::invalidationBSAName() const diff --git a/libs/game_bethesda/src/games/skyrim/skyrimdataarchives.cpp b/libs/game_bethesda/src/games/skyrim/skyrimdataarchives.cpp index 6422175..bb18510 100644 --- a/libs/game_bethesda/src/games/skyrim/skyrimdataarchives.cpp +++ b/libs/game_bethesda/src/games/skyrim/skyrimdataarchives.cpp @@ -16,8 +16,8 @@ QStringList SkyrimDataArchives::archives(const MOBase::IProfile* profile) const QStringList result; QString iniFile = profile->localSettingsEnabled() - ? QDir(profile->absolutePath()).absoluteFilePath("skyrim.ini") - : localGameDirectory().absoluteFilePath("skyrim.ini"); + ? QDir(profile->absolutePath()).absoluteFilePath("Skyrim.ini") + : localGameDirectory().absoluteFilePath("Skyrim.ini"); result.append(getArchivesFromKey(iniFile, "SResourceArchiveList")); result.append(getArchivesFromKey(iniFile, "SResourceArchiveList2")); @@ -30,8 +30,8 @@ void SkyrimDataArchives::writeArchiveList(MOBase::IProfile* profile, QString list = before.join(", "); QString iniFile = profile->localSettingsEnabled() - ? QDir(profile->absolutePath()).absoluteFilePath("skyrim.ini") - : localGameDirectory().absoluteFilePath("skyrim.ini"); + ? QDir(profile->absolutePath()).absoluteFilePath("Skyrim.ini") + : localGameDirectory().absoluteFilePath("Skyrim.ini"); if (list.length() > 255) { int splitIdx = list.lastIndexOf(",", 256); setArchivesToKey(iniFile, "SResourceArchiveList", list.mid(0, splitIdx)); diff --git a/libs/game_bethesda/src/games/skyrimse/gameskyrimse.cpp b/libs/game_bethesda/src/games/skyrimse/gameskyrimse.cpp index 5452239..d0492af 100644 --- a/libs/game_bethesda/src/games/skyrimse/gameskyrimse.cpp +++ b/libs/game_bethesda/src/games/skyrimse/gameskyrimse.cpp @@ -227,15 +227,15 @@ void GameSkyrimSE::initializeProfile(const QDir& path, ProfileSettings settings) if (settings.testFlag(IPluginGame::CONFIGURATION)) { if (settings.testFlag(IPluginGame::PREFER_DEFAULTS) || - !QFileInfo(myGamesPath() + "/skyrim.ini").exists()) { - copyToProfile(gameDirectory().absolutePath(), path, "skyrim_default.ini", - "skyrim.ini"); + !QFileInfo(myGamesPath() + "/Skyrim.ini").exists()) { + copyToProfile(gameDirectory().absolutePath(), path, "Skyrim_default.ini", + "Skyrim.ini"); } else { - copyToProfile(myGamesPath(), path, "skyrim.ini"); + copyToProfile(myGamesPath(), path, "Skyrim.ini"); } - copyToProfile(myGamesPath(), path, "skyrimprefs.ini"); - copyToProfile(myGamesPath(), path, "skyrimcustom.ini"); + copyToProfile(myGamesPath(), path, "SkyrimPrefs.ini"); + copyToProfile(myGamesPath(), path, "SkyrimCustom.ini"); } } @@ -298,7 +298,7 @@ QString GameSkyrimSE::gameNexusName() const QStringList GameSkyrimSE::iniFiles() const { - return {"skyrim.ini", "skyrimprefs.ini", "skyrimcustom.ini"}; + return {"Skyrim.ini", "SkyrimPrefs.ini", "SkyrimCustom.ini"}; } QStringList GameSkyrimSE::DLCPlugins() const diff --git a/libs/game_bethesda/src/games/skyrimse/skyrimsedataarchives.cpp b/libs/game_bethesda/src/games/skyrimse/skyrimsedataarchives.cpp index a4b5869..f3b4c4c 100644 --- a/libs/game_bethesda/src/games/skyrimse/skyrimsedataarchives.cpp +++ b/libs/game_bethesda/src/games/skyrimse/skyrimsedataarchives.cpp @@ -18,8 +18,8 @@ QStringList SkyrimSEDataArchives::archives(const MOBase::IProfile* profile) cons QStringList result; QString iniFile = profile->localSettingsEnabled() - ? QDir(profile->absolutePath()).absoluteFilePath("skyrim.ini") - : localGameDirectory().absoluteFilePath("skyrim.ini"); + ? QDir(profile->absolutePath()).absoluteFilePath("Skyrim.ini") + : localGameDirectory().absoluteFilePath("Skyrim.ini"); result.append(getArchivesFromKey(iniFile, "SResourceArchiveList")); result.append(getArchivesFromKey(iniFile, "SResourceArchiveList2")); @@ -32,8 +32,8 @@ void SkyrimSEDataArchives::writeArchiveList(MOBase::IProfile* profile, QString list = before.join(", "); QString iniFile = profile->localSettingsEnabled() - ? QDir(profile->absolutePath()).absoluteFilePath("skyrim.ini") - : localGameDirectory().absoluteFilePath("skyrim.ini"); + ? QDir(profile->absolutePath()).absoluteFilePath("Skyrim.ini") + : localGameDirectory().absoluteFilePath("Skyrim.ini"); if (list.length() > 255) { int splitIdx = list.lastIndexOf(",", 256); setArchivesToKey(iniFile, "SResourceArchiveList", list.mid(0, splitIdx)); diff --git a/libs/game_bethesda/src/games/skyrimvr/gameskyrimvr.cpp b/libs/game_bethesda/src/games/skyrimvr/gameskyrimvr.cpp index 67db6d0..625d846 100644 --- a/libs/game_bethesda/src/games/skyrimvr/gameskyrimvr.cpp +++ b/libs/game_bethesda/src/games/skyrimvr/gameskyrimvr.cpp @@ -152,13 +152,13 @@ void GameSkyrimVR::initializeProfile(const QDir& path, ProfileSettings settings) if (settings.testFlag(IPluginGame::CONFIGURATION)) { if (settings.testFlag(IPluginGame::PREFER_DEFAULTS) || - !QFileInfo(myGamesPath() + "/skyrimvr.ini").exists()) { - copyToProfile(gameDirectory().absolutePath(), path, "skyrim.ini", "skyrimvr.ini"); + !QFileInfo(myGamesPath() + "/SkyrimVR.ini").exists()) { + copyToProfile(gameDirectory().absolutePath(), path, "Skyrim.ini", "SkyrimVR.ini"); } else { - copyToProfile(myGamesPath(), path, "skyrimvr.ini"); + copyToProfile(myGamesPath(), path, "SkyrimVR.ini"); } - copyToProfile(myGamesPath(), path, "skyrimprefs.ini"); + copyToProfile(myGamesPath(), path, "SkyrimPrefs.ini"); } } @@ -224,7 +224,7 @@ QString GameSkyrimVR::gameNexusName() const QStringList GameSkyrimVR::iniFiles() const { - return {"skyrimvr.ini", "skyrimprefs.ini"}; + return {"SkyrimVR.ini", "SkyrimPrefs.ini"}; } QStringList GameSkyrimVR::DLCPlugins() const diff --git a/libs/game_bethesda/src/games/skyrimvr/skyrimvrdataarchives.cpp b/libs/game_bethesda/src/games/skyrimvr/skyrimvrdataarchives.cpp index 752aa15..6c032d9 100644 --- a/libs/game_bethesda/src/games/skyrimvr/skyrimvrdataarchives.cpp +++ b/libs/game_bethesda/src/games/skyrimvr/skyrimvrdataarchives.cpp @@ -19,8 +19,8 @@ QStringList SkyrimVRDataArchives::archives(const MOBase::IProfile* profile) cons QStringList result; QString iniFile = profile->localSettingsEnabled() - ? QDir(profile->absolutePath()).absoluteFilePath("skyrimvr.ini") - : localGameDirectory().absoluteFilePath("skyrimvr.ini"); + ? QDir(profile->absolutePath()).absoluteFilePath("SkyrimVR.ini") + : localGameDirectory().absoluteFilePath("SkyrimVR.ini"); result.append(getArchivesFromKey(iniFile, "SResourceArchiveList")); result.append(getArchivesFromKey(iniFile, "SResourceArchiveList2")); @@ -33,8 +33,8 @@ void SkyrimVRDataArchives::writeArchiveList(MOBase::IProfile* profile, QString list = before.join(", "); QString iniFile = profile->localSettingsEnabled() - ? QDir(profile->absolutePath()).absoluteFilePath("skyrimvr.ini") - : localGameDirectory().absoluteFilePath("skyrimvr.ini"); + ? QDir(profile->absolutePath()).absoluteFilePath("SkyrimVR.ini") + : localGameDirectory().absoluteFilePath("SkyrimVR.ini"); if (list.length() > 255) { int splitIdx = list.lastIndexOf(",", 256); setArchivesToKey(iniFile, "SResourceArchiveList", list.mid(0, splitIdx)); diff --git a/libs/game_bethesda/src/games/ttw/falloutttwbsainvalidation.cpp b/libs/game_bethesda/src/games/ttw/falloutttwbsainvalidation.cpp index 67a7817..c448a05 100644 --- a/libs/game_bethesda/src/games/ttw/falloutttwbsainvalidation.cpp +++ b/libs/game_bethesda/src/games/ttw/falloutttwbsainvalidation.cpp @@ -2,7 +2,7 @@ FalloutTTWBSAInvalidation::FalloutTTWBSAInvalidation(MOBase::DataArchives* dataArchives, MOBase::IPluginGame const* game) - : GamebryoBSAInvalidation(dataArchives, "fallout.ini", game) + : GamebryoBSAInvalidation(dataArchives, "Fallout.ini", game) {} QString FalloutTTWBSAInvalidation::invalidationBSAName() const diff --git a/libs/game_bethesda/src/games/ttw/falloutttwdataarchives.cpp b/libs/game_bethesda/src/games/ttw/falloutttwdataarchives.cpp index 3ffb076..e4a7766 100644 --- a/libs/game_bethesda/src/games/ttw/falloutttwdataarchives.cpp +++ b/libs/game_bethesda/src/games/ttw/falloutttwdataarchives.cpp @@ -12,8 +12,8 @@ QStringList FalloutTTWDataArchives::archives(const MOBase::IProfile* profile) co QStringList result; QString iniFile = profile->localSettingsEnabled() - ? QDir(profile->absolutePath()).absoluteFilePath("fallout.ini") - : localGameDirectory().absoluteFilePath("fallout.ini"); + ? QDir(profile->absolutePath()).absoluteFilePath("Fallout.ini") + : localGameDirectory().absoluteFilePath("Fallout.ini"); result.append(getArchivesFromKey(iniFile, "SArchiveList")); return result; @@ -25,7 +25,7 @@ void FalloutTTWDataArchives::writeArchiveList(MOBase::IProfile* profile, QString list = before.join(", "); QString iniFile = profile->localSettingsEnabled() - ? QDir(profile->absolutePath()).absoluteFilePath("fallout.ini") - : localGameDirectory().absoluteFilePath("fallout.ini"); + ? QDir(profile->absolutePath()).absoluteFilePath("Fallout.ini") + : localGameDirectory().absoluteFilePath("Fallout.ini"); setArchivesToKey(iniFile, "SArchiveList", list); } diff --git a/libs/game_bethesda/src/games/ttw/gamefalloutttw.cpp b/libs/game_bethesda/src/games/ttw/gamefalloutttw.cpp index 34eb1b2..af1ea31 100644 --- a/libs/game_bethesda/src/games/ttw/gamefalloutttw.cpp +++ b/libs/game_bethesda/src/games/ttw/gamefalloutttw.cpp @@ -41,7 +41,7 @@ bool GameFalloutTTW::init(IOrganizer* moInfo) registerFeature( std::make_shared<FalloutTTWBSAInvalidation>(dataArchives.get(), this)); registerFeature(std::make_shared<GamebryoSaveGameInfo>(this)); - registerFeature(std::make_shared<GamebryoLocalSavegames>(this, "fallout.ini")); + registerFeature(std::make_shared<GamebryoLocalSavegames>(this, "Fallout.ini")); registerFeature(std::make_shared<FalloutTTWModDataChecker>(this)); registerFeature( std::make_shared<FalloutTTWModDataContent>(m_Organizer->gameFeatures())); @@ -222,15 +222,15 @@ void GameFalloutTTW::initializeProfile(const QDir& path, ProfileSettings setting if (settings.testFlag(IPluginGame::CONFIGURATION)) { if (settings.testFlag(IPluginGame::PREFER_DEFAULTS) || - !QFileInfo(myGamesPath() + "/fallout.ini").exists()) { - copyToProfile(gameDirectory().absolutePath(), path, "fallout_default.ini", - "fallout.ini"); + !QFileInfo(myGamesPath() + "/Fallout.ini").exists()) { + copyToProfile(gameDirectory().absolutePath(), path, "Fallout_default.ini", + "Fallout.ini"); } else { - copyToProfile(myGamesPath(), path, "fallout.ini"); + copyToProfile(myGamesPath(), path, "Fallout.ini"); } - copyToProfile(myGamesPath(), path, "falloutprefs.ini"); - copyToProfile(myGamesPath(), path, "falloutcustom.ini"); + copyToProfile(myGamesPath(), path, "FalloutPrefs.ini"); + copyToProfile(myGamesPath(), path, "FalloutCustom.ini"); copyToProfile(myGamesPath(), path, "GECKCustom.ini"); copyToProfile(myGamesPath(), path, "GECKPrefs.ini"); } @@ -306,7 +306,7 @@ QString GameFalloutTTW::gameNexusName() const QStringList GameFalloutTTW::iniFiles() const { - return {"fallout.ini", "falloutprefs.ini", "falloutcustom.ini", "GECKCustom.ini", + return {"Fallout.ini", "FalloutPrefs.ini", "FalloutCustom.ini", "GECKCustom.ini", "GECKPrefs.ini"}; } diff --git a/libs/nak/src/paths.rs b/libs/nak/src/paths.rs index 4b212b9..e86c284 100644 --- a/libs/nak/src/paths.rs +++ b/libs/nak/src/paths.rs @@ -1,12 +1,11 @@ //! Shared data directory for Fluorine Manager. //! -//! All data lives under `~/.local/share/fluorine/` — accessible from both -//! native and Flatpak builds (the Flatpak has `--filesystem=home`). +//! All data lives under `~/.var/app/com.fluorine.manager/`. use std::path::PathBuf; -/// Returns the Fluorine data directory (`~/.local/share/fluorine`). +/// Returns the Fluorine data directory (`~/.var/app/com.fluorine.manager`). pub fn data_dir() -> PathBuf { let home = std::env::var("HOME").unwrap_or_else(|_| "/tmp".to_string()); - PathBuf::from(home).join(".local/share/fluorine") + PathBuf::from(home).join(".var/app/com.fluorine.manager") } diff --git a/libs/usvfs/src/shared/directory_tree.cpp b/libs/usvfs/src/shared/directory_tree.cpp index 34cc797..33d7ae1 100644 --- a/libs/usvfs/src/shared/directory_tree.cpp +++ b/libs/usvfs/src/shared/directory_tree.cpp @@ -34,6 +34,10 @@ fs::path::iterator nextIter(const fs::path::iterator& iter, void advanceIter(fs::path::iterator& iter, const fs::path::iterator& end) { + if (iter == end) { + return; + } + ++iter; while (iter != end && (iter->wstring() == L"/" || iter->wstring() == L"\\" || iter->wstring() == L".")) diff --git a/libs/usvfs/src/shared/directory_tree.h b/libs/usvfs/src/shared/directory_tree.h index f82187f..1712071 100644 --- a/libs/usvfs/src/shared/directory_tree.h +++ b/libs/usvfs/src/shared/directory_tree.h @@ -327,6 +327,9 @@ public: NodePtrT findNode(const fs::path& path) { fs::path::iterator iter = path.begin(); + if (iter == path.end()) { + return NodePtrT(); + } return findNode(path, iter); } @@ -338,6 +341,9 @@ public: const NodePtrT findNode(const fs::path& path) const { fs::path::iterator iter = path.begin(); + if (iter == path.end()) { + return NodePtrT(); + } return findNode(path, iter); } @@ -350,6 +356,9 @@ public: void visitPath(const fs::path& path, const VisitorFunction& visitor) const { fs::path::iterator iter = path.begin(); + if (iter == path.end()) { + return; + } visitPath(path, iter, visitor); } @@ -526,6 +535,10 @@ public: NodePtrT findNode(const fs::path& name, fs::path::iterator& iter) { + if (iter == name.end()) { + return NodePtrT(); + } + std::string l = iter->string(); auto subNode = m_Nodes.find(iter->string()); advanceIter(iter, name.end()); @@ -548,6 +561,10 @@ public: const NodePtrT findNode(const fs::path& name, fs::path::iterator& iter) const { + if (iter == name.end()) { + return NodePtrT(); + } + auto subNode = m_Nodes.find(iter->string()); advanceIter(iter, name.end()); @@ -570,6 +587,10 @@ public: void visitPath(const fs::path& path, fs::path::iterator& iter, const VisitorFunction& visitor) const { + if (iter == path.end()) { + return; + } + auto subNode = m_Nodes.find(iter->string()); if (subNode != m_Nodes.end()) { |
