|
game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
|
Scans for installed games from various sources. More...
#include <game_scanner_service.h>
Public Types | |
| using | CompletionCallback = std::function<void(const std::vector<ScannedGame>&)> |
| using | ProgressCallback = std::function<void(const ScanProgress&)> |
Static Public Member Functions | |
| static std::string | getSourceDisplayName (GameSource source) |
| Get display name for a game source. | |
| static std::string | getSourceIcon (GameSource source) |
| Get icon name for a game source. | |
| static bool | isBottlesInstalled () |
| Check if Bottles is installed. | |
| static bool | isHeroicInstalled () |
| Check if Heroic Launcher is installed. | |
| static bool | isLegendaryInstalled () |
| Check if Legendary is installed. | |
| static bool | isLutrisInstalled () |
| Check if Lutris is installed. | |
| static void | markAlreadyImported (std::vector< ScannedGame > &games, const std::vector< Game > &library) |
| Mark games that are already in the library. | |
| static std::vector< ScannedGame > | removeDuplicates (std::vector< ScannedGame > games) |
| Remove duplicate games from the list. | |
| static std::vector< ScannedGame > | scanAll (ProgressCallback progressCallback=nullptr) |
| Scan all available sources for games. | |
| static void | scanAllAsync (const CompletionCallback &onComplete, const ProgressCallback &onProgress=nullptr) |
| Scan all sources asynchronously. | |
| static std::vector< ScannedGame > | scanBottles () |
| Scan Bottles for installed games. | |
| static std::vector< ScannedGame > | scanHeroic () |
| Scan Heroic Launcher for Epic and GOG games. | |
| static std::vector< ScannedGame > | scanLegendary () |
| Scan Legendary (Epic Games CLI) for installed games. | |
| static std::vector< ScannedGame > | scanLutris () |
| Scan Lutris for installed games. | |
| static std::vector< ScannedGame > | scanNativeGames () |
| Scan for native Linux games. | |
| static std::vector< ScannedGame > | scanWinePrefixes () |
| Scan generic Wine prefixes for games. | |
| static void | setCustomScanDirectories (const std::vector< std::string > &dirs) |
| Set custom scan directories for native game scanning. | |
Scans for installed games from various sources.
This service detects games installed via Lutris, Bottles, Heroic Launcher, Legendary, and other common Linux gaming platforms. It can also scan for native Linux games and generic Wine prefixes.
Definition at line 134 of file game_scanner_service.h.
| using GameScannerService::CompletionCallback = std::function<void(const std::vector<ScannedGame>&)> |
Definition at line 138 of file game_scanner_service.h.
| using GameScannerService::ProgressCallback = std::function<void(const ScanProgress&)> |
Definition at line 137 of file game_scanner_service.h.
|
static |
|
static |
|
static |
Check if Bottles is installed.
Definition at line 340 of file game_scanner_service.cpp.
Referenced by GameImportDialog::GameImportDialog(), and scanAll().
|
static |
Check if Heroic Launcher is installed.
Definition at line 346 of file game_scanner_service.cpp.
Referenced by GameImportDialog::GameImportDialog(), and scanAll().
|
static |
Check if Legendary is installed.
Definition at line 352 of file game_scanner_service.cpp.
Referenced by GameImportDialog::GameImportDialog(), and scanAll().
|
static |
Check if Lutris is installed.
Definition at line 334 of file game_scanner_service.cpp.
References LutrisConfigParser::getGamesDirectory().
Referenced by GameImportDialog::GameImportDialog(), and scanAll().
|
static |
Mark games that are already in the library.
| games | List of scanned games to check |
| library | Current game library |
Definition at line 1814 of file game_scanner_service.cpp.
References ScannedGame::alreadyImported, Logger::debug(), ScannedGame::executablePath, ScannedGame::existingGameId, ScannedGame::id, ScannedGame::installDir, ScannedGame::name, and ScannedGame::steamAppId.
|
static |
Remove duplicate games from the list.
| games | List of scanned games |
Definition at line 1744 of file game_scanner_service.cpp.
References Epic, ScannedGame::executablePath, GOG, Local, Lutris, ScannedGame::source, Steam, and ScannedGame::steamAppId.
Referenced by scanAll().
|
static |
Scan all available sources for games.
| progressCallback | Optional callback for progress updates |
Definition at line 1622 of file game_scanner_service.cpp.
References ScanProgress::addError(), ScanProgress::currentOperation, ScanProgress::currentSource, Logger::debug(), ScanProgress::errors, ScanProgress::gamesFound, ScanProgress::hasErrors(), Logger::info(), isBottlesInstalled(), isHeroicInstalled(), isLegendaryInstalled(), isLutrisInstalled(), ScanProgress::overallPercent, removeDuplicates(), scanBottles(), scanHeroic(), scanLegendary(), scanLutris(), scanNativeGames(), scanWinePrefixes(), ScanProgress::sourcesCompleted, ScanProgress::totalSources, and Logger::warn().
Referenced by scanAllAsync().
|
static |
Scan all sources asynchronously.
| onComplete | Callback with results |
| onProgress | Optional progress callback |
Definition at line 1726 of file game_scanner_service.cpp.
References scanAll().
|
static |
Scan Bottles for installed games.
Definition at line 716 of file game_scanner_service.cpp.
References Logger::info(), and Logger::warn().
Referenced by scanAll().
|
static |
Scan Heroic Launcher for Epic and GOG games.
Definition at line 885 of file game_scanner_service.cpp.
References Epic, GOG, and Logger::info().
Referenced by scanAll().
|
static |
Scan Legendary (Epic Games CLI) for installed games.
Definition at line 1091 of file game_scanner_service.cpp.
References Logger::info().
Referenced by scanAll().
|
static |
Scan Lutris for installed games.
Definition at line 412 of file game_scanner_service.cpp.
References LutrisConfigParser::getGamesDirectory(), Logger::info(), and Logger::warn().
Referenced by scanAll().
|
static |
Scan for native Linux games.
Definition at line 1199 of file game_scanner_service.cpp.
References Logger::debug(), ScannedGame::executablePath, ScannedGame::generateId(), Logger::info(), ScannedGame::installDir, ScannedGame::lastModified, Local, ScannedGame::name, Native, ScannedGame::runner, ScannedGame::sizeOnDisk, and ScannedGame::source.
Referenced by scanAll().
|
static |
Scan generic Wine prefixes for games.
Definition at line 1559 of file game_scanner_service.cpp.
References Logger::info(), Local, and ScannedGame::source.
Referenced by scanAll().
|
static |
Set custom scan directories for native game scanning.
| dirs | List of directory paths to scan in addition to hardcoded defaults |
Call this during app initialization (e.g., after loading settings). These directories are appended to the built-in scan list in scanNativeGames().
Definition at line 79 of file game_scanner_service.cpp.