summaryrefslogtreecommitdiffstats
path: root/src/yuzu/game_list_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/yuzu/game_list_p.h')
-rw-r--r--src/yuzu/game_list_p.h76
1 files changed, 10 insertions, 66 deletions
diff --git a/src/yuzu/game_list_p.h b/src/yuzu/game_list_p.h
index a70a151c5..2720bf143 100644
--- a/src/yuzu/game_list_p.h
+++ b/src/yuzu/game_list_p.h
@@ -6,9 +6,7 @@
#include <algorithm>
#include <array>
-#include <atomic>
#include <map>
-#include <memory>
#include <string>
#include <unordered_map>
#include <utility>
@@ -16,7 +14,6 @@
#include <QCoreApplication>
#include <QImage>
#include <QObject>
-#include <QRunnable>
#include <QStandardItem>
#include <QString>
@@ -26,12 +23,6 @@
#include "yuzu/ui_settings.h"
#include "yuzu/util/util.h"
-namespace FileSys {
-class NCA;
-class RegisteredCache;
-class VfsFilesystem;
-} // namespace FileSys
-
/**
* Gets the default icon (for games without valid SMDH)
* @param large If true, returns large icon (48x48), otherwise returns small icon (24x24)
@@ -43,17 +34,6 @@ static QPixmap GetDefaultIcon(u32 size) {
return icon;
}
-static auto FindMatchingCompatibilityEntry(
- const std::unordered_map<std::string, std::pair<QString, QString>>& compatibility_list,
- u64 program_id) {
- return std::find_if(
- compatibility_list.begin(), compatibility_list.end(),
- [program_id](const std::pair<std::string, std::pair<QString, QString>>& element) {
- std::string pid = fmt::format("{:016X}", program_id);
- return element.first == pid;
- });
-}
-
class GameListItem : public QStandardItem {
public:
@@ -197,49 +177,13 @@ public:
}
};
-/**
- * Asynchronous worker object for populating the game list.
- * Communicates with other threads through Qt's signal/slot system.
- */
-class GameListWorker : public QObject, public QRunnable {
- Q_OBJECT
-
-public:
- GameListWorker(
- std::shared_ptr<FileSys::VfsFilesystem> vfs, QString dir_path, bool deep_scan,
- const std::unordered_map<std::string, std::pair<QString, QString>>& compatibility_list);
- ~GameListWorker() override;
-
-public slots:
- /// Starts the processing of directory tree information.
- void run() override;
- /// Tells the worker that it should no longer continue processing. Thread-safe.
- void Cancel();
-
-signals:
- /**
- * The `EntryReady` signal is emitted once an entry has been prepared and is ready
- * to be added to the game list.
- * @param entry_items a list with `QStandardItem`s that make up the columns of the new entry.
- */
- void EntryReady(QList<QStandardItem*> entry_items);
-
- /**
- * After the worker has traversed the game directory looking for entries, this signal is emmited
- * with a list of folders that should be watched for changes as well.
- */
- void Finished(QStringList watch_list);
-
-private:
- std::shared_ptr<FileSys::VfsFilesystem> vfs;
- std::map<u64, std::shared_ptr<FileSys::NCA>> nca_control_map;
- QStringList watch_list;
- QString dir_path;
- bool deep_scan;
- const std::unordered_map<std::string, std::pair<QString, QString>>& compatibility_list;
- std::atomic_bool stop_processing;
-
- void AddInstalledTitlesToGameList();
- void FillControlMap(const std::string& dir_path);
- void AddFstEntriesToGameList(const std::string& dir_path, unsigned int recursion = 0);
-};
+inline auto FindMatchingCompatibilityEntry(
+ const std::unordered_map<std::string, std::pair<QString, QString>>& compatibility_list,
+ u64 program_id) {
+ return std::find_if(
+ compatibility_list.begin(), compatibility_list.end(),
+ [program_id](const std::pair<std::string, std::pair<QString, QString>>& element) {
+ std::string pid = fmt::format("{:016X}", program_id);
+ return element.first == pid;
+ });
+}