| 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 |
no test coverage detected