|
|
@ -5,6 +5,7 @@
|
|
|
|
#pragma once
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
|
|
#include <atomic>
|
|
|
|
#include <atomic>
|
|
|
|
|
|
|
|
#include <utility>
|
|
|
|
#include <QImage>
|
|
|
|
#include <QImage>
|
|
|
|
#include <QRunnable>
|
|
|
|
#include <QRunnable>
|
|
|
|
#include <QStandardItem>
|
|
|
|
#include <QStandardItem>
|
|
|
@ -27,9 +28,8 @@ static QPixmap GetDefaultIcon(bool large) {
|
|
|
|
class GameListItem : public QStandardItem {
|
|
|
|
class GameListItem : public QStandardItem {
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
GameListItem() : QStandardItem() {}
|
|
|
|
GameListItem() = default;
|
|
|
|
GameListItem(const QString& string) : QStandardItem(string) {}
|
|
|
|
explicit GameListItem(const QString& string) : QStandardItem(string) {}
|
|
|
|
virtual ~GameListItem() override {}
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -45,9 +45,8 @@ public:
|
|
|
|
static const int TitleRole = Qt::UserRole + 2;
|
|
|
|
static const int TitleRole = Qt::UserRole + 2;
|
|
|
|
static const int ProgramIdRole = Qt::UserRole + 3;
|
|
|
|
static const int ProgramIdRole = Qt::UserRole + 3;
|
|
|
|
|
|
|
|
|
|
|
|
GameListItemPath() : GameListItem() {}
|
|
|
|
GameListItemPath() = default;
|
|
|
|
GameListItemPath(const QString& game_path, const std::vector<u8>& smdh_data, u64 program_id)
|
|
|
|
GameListItemPath(const QString& game_path, const std::vector<u8>& smdh_data, u64 program_id) {
|
|
|
|
: GameListItem() {
|
|
|
|
|
|
|
|
setData(game_path, FullPathRole);
|
|
|
|
setData(game_path, FullPathRole);
|
|
|
|
setData(qulonglong(program_id), ProgramIdRole);
|
|
|
|
setData(qulonglong(program_id), ProgramIdRole);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -75,8 +74,8 @@ class GameListItemSize : public GameListItem {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
static const int SizeRole = Qt::UserRole + 1;
|
|
|
|
static const int SizeRole = Qt::UserRole + 1;
|
|
|
|
|
|
|
|
|
|
|
|
GameListItemSize() : GameListItem() {}
|
|
|
|
GameListItemSize() = default;
|
|
|
|
GameListItemSize(const qulonglong size_bytes) : GameListItem() {
|
|
|
|
explicit GameListItemSize(const qulonglong size_bytes) {
|
|
|
|
setData(size_bytes, SizeRole);
|
|
|
|
setData(size_bytes, SizeRole);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -111,7 +110,7 @@ class GameListWorker : public QObject, public QRunnable {
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
GameListWorker(QString dir_path, bool deep_scan)
|
|
|
|
GameListWorker(QString dir_path, bool deep_scan)
|
|
|
|
: QObject(), QRunnable(), dir_path(dir_path), deep_scan(deep_scan) {}
|
|
|
|
: dir_path(std::move(dir_path)), deep_scan(deep_scan) {}
|
|
|
|
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
public slots:
|
|
|
|
/// Starts the processing of directory tree information.
|
|
|
|
/// Starts the processing of directory tree information.
|
|
|
|