mirror of
https://git.eden-emu.dev/archive/citron
synced 2026-03-23 01:56:08 -04:00
Edit game_list_worker.h
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
@@ -7,6 +8,8 @@
|
|||||||
#include <deque>
|
#include <deque>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <map> // Required for the online_stats map
|
||||||
|
#include <utility> // Required for std::pair
|
||||||
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
@@ -16,17 +19,21 @@
|
|||||||
#include "common/thread.h"
|
#include "common/thread.h"
|
||||||
#include "citron/compatibility_list.h"
|
#include "citron/compatibility_list.h"
|
||||||
#include "citron/play_time_manager.h"
|
#include "citron/play_time_manager.h"
|
||||||
|
#include "citron/multiplayer/state.h"
|
||||||
|
#include "network/announce_multiplayer_session.h"
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
class System;
|
class System;
|
||||||
}
|
}
|
||||||
|
|
||||||
class GameList;
|
class GameList;
|
||||||
|
class GameListDir; // Forward declare GameListDir
|
||||||
class QStandardItem;
|
class QStandardItem;
|
||||||
|
|
||||||
namespace FileSys {
|
namespace FileSys {
|
||||||
class NCA;
|
class NCA;
|
||||||
class VfsFilesystem;
|
class VfsFilesystem;
|
||||||
|
class ManualContentProvider;
|
||||||
} // namespace FileSys
|
} // namespace FileSys
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -37,12 +44,18 @@ class GameListWorker : public QObject, public QRunnable {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
enum class ScanTarget {
|
||||||
|
FillManualContentProvider,
|
||||||
|
PopulateGameList,
|
||||||
|
};
|
||||||
|
|
||||||
explicit GameListWorker(std::shared_ptr<FileSys::VfsFilesystem> vfs_,
|
explicit GameListWorker(std::shared_ptr<FileSys::VfsFilesystem> vfs_,
|
||||||
FileSys::ManualContentProvider* provider_,
|
FileSys::ManualContentProvider* provider_,
|
||||||
QVector<UISettings::GameDir>& game_dirs_,
|
QVector<UISettings::GameDir>& game_dirs_,
|
||||||
const CompatibilityList& compatibility_list_,
|
const CompatibilityList& compatibility_list_,
|
||||||
const PlayTime::PlayTimeManager& play_time_manager_,
|
const PlayTime::PlayTimeManager& play_time_manager_,
|
||||||
Core::System& system_);
|
Core::System& system_,
|
||||||
|
std::shared_ptr<Core::AnnounceMultiplayerSession> session_);
|
||||||
~GameListWorker() override;
|
~GameListWorker() override;
|
||||||
|
|
||||||
/// Starts the processing of directory tree information.
|
/// Starts the processing of directory tree information.
|
||||||
@@ -66,15 +79,12 @@ private:
|
|||||||
void RecordEvent(F&& func);
|
void RecordEvent(F&& func);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void AddTitlesToGameList(GameListDir* parent_dir);
|
void AddTitlesToGameList(GameListDir* parent_dir,
|
||||||
|
const std::map<u64, std::pair<int, int>>& online_stats);
|
||||||
enum class ScanTarget {
|
|
||||||
FillManualContentProvider,
|
|
||||||
PopulateGameList,
|
|
||||||
};
|
|
||||||
|
|
||||||
void ScanFileSystem(ScanTarget target, const std::string& dir_path, bool deep_scan,
|
void ScanFileSystem(ScanTarget target, const std::string& dir_path, bool deep_scan,
|
||||||
GameListDir* parent_dir);
|
GameListDir* parent_dir,
|
||||||
|
const std::map<u64, std::pair<int, int>>& online_stats);
|
||||||
|
|
||||||
std::shared_ptr<FileSys::VfsFilesystem> vfs;
|
std::shared_ptr<FileSys::VfsFilesystem> vfs;
|
||||||
FileSys::ManualContentProvider* provider;
|
FileSys::ManualContentProvider* provider;
|
||||||
@@ -91,4 +101,5 @@ private:
|
|||||||
Common::Event processing_completed;
|
Common::Event processing_completed;
|
||||||
|
|
||||||
Core::System& system;
|
Core::System& system;
|
||||||
|
std::shared_ptr<Core::AnnounceMultiplayerSession> session;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user