MCPcopy Create free account
hub / github.com/OpenMW/openmw / getInstallPaths

Method getInstallPaths

components/files/linuxpath.cpp:105–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103 }
104
105 std::vector<std::filesystem::path> LinuxPath::getInstallPaths() const
106 {
107 std::filesystem::path homePath = getUserHome();
108 if (homePath.empty())
109 return {};
110
111 std::vector<std::filesystem::path> paths(Wine::getInstallPaths(homePath));
112 std::array steamPaths{
113 // Default (~/.steam/steam can be a symlink or a real directory)
114 homePath / ".steam/steam/steamapps/common/Morrowind",
115 // Snap
116 homePath / "snap/steam/common/.local/share/Steam/steamapps/common/Morrowind",
117 // Flatpak
118 homePath / ".var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common/Morrowind",
119 };
120 for (const std::filesystem::path& steam : steamPaths)
121 {
122 if (std::filesystem::is_directory(steam))
123 paths.emplace_back(steam);
124 }
125 std::ranges::sort(paths);
126 const auto [first, last] = std::ranges::unique(paths);
127 paths.erase(first, last);
128 return paths;
129 }
130
131} /* namespace Files */
132

Callers 1

MainWizardMethod · 0.45

Calls 4

getInstallPathsFunction · 0.85
getUserHomeFunction · 0.70
emptyMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected