Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Suyu
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Suyu
Commits
94d27b17
There was an error fetching the commit references. Please try again later.
Commit
94d27b17
authored
6 years ago
by
Zach Hilman
Browse files
Options
Downloads
Patches
Plain Diff
Recognize main files in game list
parent
17f3590d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/yuzu/game_list.cpp
+17
-2
17 additions, 2 deletions
src/yuzu/game_list.cpp
with
17 additions
and
2 deletions
src/yuzu/game_list.cpp
+
17
−
2
View file @
94d27b17
...
...
@@ -3,6 +3,7 @@
// Refer to the license.txt file included.
#include
<QApplication>
#include
<QDir>
#include
<QFileInfo>
#include
<QHeaderView>
#include
<QKeyEvent>
...
...
@@ -363,6 +364,19 @@ static bool HasSupportedFileExtension(const std::string& file_name) {
return
GameList
::
supported_file_extensions
.
contains
(
file
.
suffix
(),
Qt
::
CaseInsensitive
);
}
static
bool
IsExtractedNCAMain
(
const
std
::
string
&
file_name
)
{
return
QFileInfo
(
file_name
.
c_str
()).
fileName
()
==
"main"
;
}
static
QString
FormatGameName
(
std
::
string
physical_name
)
{
QFileInfo
fileInfo
(
physical_name
.
c_str
());
if
(
IsExtractedNCAMain
(
physical_name
))
{
return
fileInfo
.
dir
().
dirName
();
}
else
{
return
QString
::
fromStdString
(
physical_name
);
}
}
void
GameList
::
RefreshGameDirectory
()
{
if
(
!
UISettings
::
values
.
gamedir
.
isEmpty
()
&&
current_worker
!=
nullptr
)
{
NGLOG_INFO
(
Frontend
,
"Change detected in the games directory. Reloading game list."
);
...
...
@@ -380,7 +394,8 @@ void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, unsign
return
false
;
// Breaks the callback loop.
bool
is_dir
=
FileUtil
::
IsDirectory
(
physical_name
);
if
(
!
is_dir
&&
HasSupportedFileExtension
(
physical_name
))
{
if
(
!
is_dir
&&
(
HasSupportedFileExtension
(
physical_name
)
||
IsExtractedNCAMain
(
physical_name
)))
{
std
::
unique_ptr
<
Loader
::
AppLoader
>
loader
=
Loader
::
GetLoader
(
physical_name
);
if
(
!
loader
)
return
true
;
...
...
@@ -392,7 +407,7 @@ void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, unsign
loader
->
ReadProgramId
(
program_id
);
emit
EntryReady
({
new
GameListItemPath
(
QString
::
fromStdString
(
physical_name
),
smdh
,
program_id
),
new
GameListItemPath
(
FormatGameName
(
physical_name
),
smdh
,
program_id
),
new
GameListItem
(
QString
::
fromStdString
(
Loader
::
GetFileTypeString
(
loader
->
GetFileType
()))),
new
GameListItemSize
(
FileUtil
::
GetSize
(
physical_name
)),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment