Move GameList to FrontendCommon

Reduces libretro core dependencies further.
This commit is contained in:
Connor McLaughlin
2020-09-01 12:29:22 +10:00
parent 13e3095801
commit 6bbbb96d4b
25 changed files with 356 additions and 353 deletions

View File

@ -1,5 +1,6 @@
#include "gamelistmodel.h"
#include "common/string_util.h"
#include "core/system.h"
static constexpr std::array<const char*, GameListModel::Column_Count> s_column_names = {
{"Type", "Code", "Title", "File Title", "Size", "Region", "Compatibility"}};
@ -69,7 +70,7 @@ QVariant GameListModel::data(const QModelIndex& index, int role) const
case Column_FileTitle:
{
const std::string_view file_title(GameList::GetTitleForPath(ge.path.c_str()));
const std::string_view file_title(System::GetTitleForPath(ge.path.c_str()));
return QString::fromUtf8(file_title.data(), static_cast<int>(file_title.length()));
}
@ -96,7 +97,7 @@ QVariant GameListModel::data(const QModelIndex& index, int role) const
case Column_FileTitle:
{
const std::string_view file_title(GameList::GetTitleForPath(ge.path.c_str()));
const std::string_view file_title(System::GetTitleForPath(ge.path.c_str()));
return QString::fromUtf8(file_title.data(), static_cast<int>(file_title.length()));
}
@ -234,8 +235,8 @@ bool GameListModel::lessThan(const QModelIndex& left_index, const QModelIndex& r
case Column_FileTitle:
{
const std::string_view file_title_left(GameList::GetTitleForPath(left.path.c_str()));
const std::string_view file_title_right(GameList::GetTitleForPath(right.path.c_str()));
const std::string_view file_title_left(System::GetTitleForPath(left.path.c_str()));
const std::string_view file_title_right(System::GetTitleForPath(right.path.c_str()));
if (file_title_left == file_title_right)
return titlesLessThan(left_row, right_row, ascending);

View File

@ -1,6 +1,6 @@
#pragma once
#include "core/game_list.h"
#include "core/types.h"
#include "frontend-common/game_list.h"
#include <QtCore/QAbstractTableModel>
#include <QtGui/QPixmap>
#include <array>

View File

@ -2,7 +2,7 @@
#include "common/assert.h"
#include "common/minizip_helpers.h"
#include "common/string_util.h"
#include "core/game_list.h"
#include "frontend-common/game_list.h"
#include "gamelistsearchdirectoriesmodel.h"
#include "qthostinterface.h"
#include "qtutils.h"

View File

@ -1,7 +1,7 @@
#include "gamelistwidget.h"
#include "common/string_util.h"
#include "core/game_list.h"
#include "core/settings.h"
#include "frontend-common/game_list.h"
#include "gamelistmodel.h"
#include "qthostinterface.h"
#include "qtutils.h"

View File

@ -1,8 +1,8 @@
#include "gamepropertiesdialog.h"
#include "common/cd_image.h"
#include "common/cd_image_hasher.h"
#include "core/game_list.h"
#include "core/settings.h"
#include "frontend-common/game_list.h"
#include "qthostinterface.h"
#include "qtprogresscallback.h"
#include "qtutils.h"

View File

@ -1,5 +1,5 @@
#pragma once
#include "core/game_settings.h"
#include "frontend-common/game_settings.h"
#include "ui_gamepropertiesdialog.h"
#include <QtWidgets/QDialog>
#include <array>

View File

@ -2,10 +2,10 @@
#include "aboutdialog.h"
#include "autoupdaterdialog.h"
#include "common/assert.h"
#include "core/game_list.h"
#include "core/host_display.h"
#include "core/settings.h"
#include "core/system.h"
#include "frontend-common/game_list.h"
#include "gamelistsettingswidget.h"
#include "gamelistwidget.h"
#include "gamepropertiesdialog.h"

View File

@ -6,9 +6,9 @@
#include "common/log.h"
#include "common/string_util.h"
#include "core/controller.h"
#include "core/game_list.h"
#include "core/gpu.h"
#include "core/system.h"
#include "frontend-common/game_list.h"
#include "frontend-common/imgui_styles.h"
#include "frontend-common/ini_settings_interface.h"
#include "frontend-common/opengl_host_display.h"