diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/game_list.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index 71e24a9e2..166c16225 100644 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp | |||
| @@ -368,21 +368,23 @@ void GameList::LoadInterfaceLayout() { | |||
| 368 | const QStringList GameList::supported_file_extensions = {"nso", "nro", "nca", "xci"}; | 368 | const QStringList GameList::supported_file_extensions = {"nso", "nro", "nca", "xci"}; |
| 369 | 369 | ||
| 370 | static bool HasSupportedFileExtension(const std::string& file_name) { | 370 | static bool HasSupportedFileExtension(const std::string& file_name) { |
| 371 | QFileInfo file = QFileInfo(file_name.c_str()); | 371 | const QFileInfo file = QFileInfo(QString::fromStdString(file_name)); |
| 372 | return GameList::supported_file_extensions.contains(file.suffix(), Qt::CaseInsensitive); | 372 | return GameList::supported_file_extensions.contains(file.suffix(), Qt::CaseInsensitive); |
| 373 | } | 373 | } |
| 374 | 374 | ||
| 375 | static bool IsExtractedNCAMain(const std::string& file_name) { | 375 | static bool IsExtractedNCAMain(const std::string& file_name) { |
| 376 | return QFileInfo(file_name.c_str()).fileName() == "main"; | 376 | return QFileInfo(QString::fromStdString(file_name)).fileName() == "main"; |
| 377 | } | 377 | } |
| 378 | 378 | ||
| 379 | static QString FormatGameName(const std::string& physical_name) { | 379 | static QString FormatGameName(const std::string& physical_name) { |
| 380 | QFileInfo file_info(physical_name.c_str()); | 380 | const QString physical_name_as_qstring = QString::fromStdString(physical_name); |
| 381 | const QFileInfo file_info(physical_name_as_qstring); | ||
| 382 | |||
| 381 | if (IsExtractedNCAMain(physical_name)) { | 383 | if (IsExtractedNCAMain(physical_name)) { |
| 382 | return file_info.dir().path(); | 384 | return file_info.dir().path(); |
| 383 | } else { | ||
| 384 | return QString::fromStdString(physical_name); | ||
| 385 | } | 385 | } |
| 386 | |||
| 387 | return physical_name_as_qstring; | ||
| 386 | } | 388 | } |
| 387 | 389 | ||
| 388 | void GameList::RefreshGameDirectory() { | 390 | void GameList::RefreshGameDirectory() { |