mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-23 03:02:53 +01:00
Qt: move compat_status to game_compatibility.h
This commit is contained in:
parent
5492e0eae1
commit
c10e195dba
@ -70,13 +70,13 @@ void game_compatibility::RequestCompatibility(bool online)
|
||||
QJsonObject json_result = json_results[key].toObject();
|
||||
|
||||
// Retrieve compatibility information from json
|
||||
Compat_Status compat_status = Status_Data.at(json_result.value("status").toString("NoResult"));
|
||||
compat_status status = Status_Data.at(json_result.value("status").toString("NoResult"));
|
||||
|
||||
// Add date if possible
|
||||
compat_status.date = json_result.value("date").toString();
|
||||
status.date = json_result.value("date").toString();
|
||||
|
||||
// Add status to map
|
||||
m_compat_database.emplace(std::pair<std::string, Compat_Status>(sstr(key), compat_status));
|
||||
m_compat_database.emplace(std::pair<std::string, compat_status>(sstr(key), status));
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -220,7 +220,7 @@ void game_compatibility::RequestCompatibility(bool online)
|
||||
Q_EMIT DownloadStarted();
|
||||
}
|
||||
|
||||
Compat_Status game_compatibility::GetCompatibility(const std::string& title_id)
|
||||
compat_status game_compatibility::GetCompatibility(const std::string& title_id)
|
||||
{
|
||||
if (m_compat_database.empty())
|
||||
{
|
||||
@ -234,7 +234,7 @@ Compat_Status game_compatibility::GetCompatibility(const std::string& title_id)
|
||||
return Status_Data.at("NoResult");
|
||||
}
|
||||
|
||||
Compat_Status game_compatibility::GetStatusData(const QString& status)
|
||||
compat_status game_compatibility::GetStatusData(const QString& status)
|
||||
{
|
||||
return Status_Data.at(status);
|
||||
}
|
||||
|
@ -15,11 +15,20 @@
|
||||
|
||||
#include "gui_settings.h"
|
||||
|
||||
struct compat_status
|
||||
{
|
||||
int index;
|
||||
QString date;
|
||||
QString color;
|
||||
QString text;
|
||||
QString tooltip;
|
||||
};
|
||||
|
||||
class game_compatibility : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
const std::map<QString, Compat_Status> Status_Data =
|
||||
const std::map<QString, compat_status> Status_Data =
|
||||
{
|
||||
{ "Playable", { 0, "", "#1ebc61", QObject::tr("Playable"), QObject::tr("Games that can be properly played from start to finish") } },
|
||||
{ "Ingame", { 1, "", "#f9b32f", QObject::tr("Ingame"), QObject::tr("Games that either can't be finished, have serious glitches or have insufficient performance") } },
|
||||
@ -38,7 +47,7 @@ class game_compatibility : public QObject
|
||||
std::unique_ptr<QTimer> m_progress_timer;
|
||||
std::unique_ptr<QProgressDialog> m_progress_dialog;
|
||||
std::unique_ptr<QNetworkAccessManager> m_network_access_manager;
|
||||
std::map<std::string, Compat_Status> m_compat_database;
|
||||
std::map<std::string, compat_status> m_compat_database;
|
||||
|
||||
public:
|
||||
/** Handles reads, writes and downloads for the compatibility database */
|
||||
@ -48,10 +57,10 @@ public:
|
||||
void RequestCompatibility(bool online = false);
|
||||
|
||||
/** Returns the compatibility status for the requested title */
|
||||
Compat_Status GetCompatibility(const std::string& title_id);
|
||||
compat_status GetCompatibility(const std::string& title_id);
|
||||
|
||||
/** Returns the data for the requested status */
|
||||
Compat_Status GetStatusData(const QString& status);
|
||||
compat_status GetStatusData(const QString& status);
|
||||
|
||||
Q_SIGNALS:
|
||||
void DownloadStarted();
|
||||
|
@ -163,7 +163,7 @@ namespace sound
|
||||
struct GUI_GameInfo
|
||||
{
|
||||
GameInfo info;
|
||||
Compat_Status compat;
|
||||
compat_status compat;
|
||||
QImage icon;
|
||||
QPixmap pxmap;
|
||||
bool bootable;
|
||||
|
@ -10,15 +10,6 @@
|
||||
#include <QBitmap>
|
||||
#include <QLabel>
|
||||
|
||||
struct Compat_Status
|
||||
{
|
||||
int index;
|
||||
QString date;
|
||||
QString color;
|
||||
QString text;
|
||||
QString tooltip;
|
||||
};
|
||||
|
||||
struct gui_save
|
||||
{
|
||||
QString key;
|
||||
|
Loading…
Reference in New Issue
Block a user