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
e7e3d589
There was an error fetching the commit references. Please try again later.
Commit
e7e3d589
authored
6 years ago
by
Zach Hilman
Browse files
Options
Downloads
Patches
Plain Diff
settings: Add users and current_user settings and remove username
parent
50e4e81f
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/core/settings.h
+3
-1
3 additions, 1 deletion
src/core/settings.h
src/yuzu/configuration/config.cpp
+32
-2
32 additions, 2 deletions
src/yuzu/configuration/config.cpp
src/yuzu_cmd/config.cpp
+19
-3
19 additions, 3 deletions
src/yuzu_cmd/config.cpp
with
54 additions
and
6 deletions
src/core/settings.h
+
3
−
1
View file @
e7e3d589
...
...
@@ -8,6 +8,7 @@
#include
<atomic>
#include
<string>
#include
"common/common_types.h"
#include
"core/hle/service/acc/profile_manager.h"
namespace
Settings
{
...
...
@@ -114,7 +115,8 @@ struct Values {
// System
bool
use_docked_mode
;
bool
enable_nfc
;
std
::
string
username
;
int
current_user
;
std
::
vector
<
std
::
pair
<
std
::
string
,
Service
::
Account
::
UUID
>>
users
;
int
language_index
;
// Controls
...
...
This diff is collapsed.
Click to expand it.
src/yuzu/configuration/config.cpp
+
32
−
2
View file @
e7e3d589
...
...
@@ -123,7 +123,25 @@ void Config::ReadValues() {
qt_config
->
beginGroup
(
"System"
);
Settings
::
values
.
use_docked_mode
=
qt_config
->
value
(
"use_docked_mode"
,
false
).
toBool
();
Settings
::
values
.
enable_nfc
=
qt_config
->
value
(
"enable_nfc"
,
true
).
toBool
();
Settings
::
values
.
username
=
qt_config
->
value
(
"username"
,
"yuzu"
).
toString
().
toStdString
();
Settings
::
values
.
users
.
clear
();
const
auto
size
=
qt_config
->
beginReadArray
(
"users"
);
for
(
int
i
=
0
;
i
<
size
;
++
i
)
{
qt_config
->
setArrayIndex
(
i
);
const
Service
::
Account
::
UUID
uuid
(
qt_config
->
value
(
"uuid_low"
).
toULongLong
(),
qt_config
->
value
(
"uuid_high"
).
toULongLong
());
Settings
::
values
.
users
.
emplace_back
(
qt_config
->
value
(
"username"
).
toString
().
toStdString
(),
uuid
);
}
qt_config
->
endArray
();
if
(
Settings
::
values
.
users
.
empty
())
Settings
::
values
.
users
.
emplace_back
(
"yuzu"
,
Service
::
Account
::
UUID
{}.
Generate
());
Settings
::
values
.
current_user
=
std
::
clamp
(
qt_config
->
value
(
"current_user"
,
0
).
toInt
(),
0
,
size
);
Settings
::
values
.
language_index
=
qt_config
->
value
(
"language_index"
,
1
).
toInt
();
qt_config
->
endGroup
();
...
...
@@ -260,7 +278,19 @@ void Config::SaveValues() {
qt_config
->
beginGroup
(
"System"
);
qt_config
->
setValue
(
"use_docked_mode"
,
Settings
::
values
.
use_docked_mode
);
qt_config
->
setValue
(
"enable_nfc"
,
Settings
::
values
.
enable_nfc
);
qt_config
->
setValue
(
"username"
,
QString
::
fromStdString
(
Settings
::
values
.
username
));
qt_config
->
setValue
(
"current_user"
,
Settings
::
values
.
current_user
);
qt_config
->
beginWriteArray
(
"users"
,
Settings
::
values
.
users
.
size
());
for
(
std
::
size_t
i
=
0
;
i
<
Settings
::
values
.
users
.
size
();
++
i
)
{
qt_config
->
setArrayIndex
(
i
);
const
auto
&
user
=
Settings
::
values
.
users
[
i
];
qt_config
->
setValue
(
"uuid_low"
,
user
.
second
.
uuid
[
0
]);
qt_config
->
setValue
(
"uuid_high"
,
user
.
second
.
uuid
[
1
]);
qt_config
->
setValue
(
"username"
,
QString
::
fromStdString
(
user
.
first
));
}
qt_config
->
endArray
();
qt_config
->
setValue
(
"language_index"
,
Settings
::
values
.
language_index
);
qt_config
->
endGroup
();
...
...
This diff is collapsed.
Click to expand it.
src/yuzu_cmd/config.cpp
+
19
−
3
View file @
e7e3d589
...
...
@@ -126,9 +126,25 @@ void Config::ReadValues() {
// System
Settings
::
values
.
use_docked_mode
=
sdl2_config
->
GetBoolean
(
"System"
,
"use_docked_mode"
,
false
);
Settings
::
values
.
enable_nfc
=
sdl2_config
->
GetBoolean
(
"System"
,
"enable_nfc"
,
true
);
Settings
::
values
.
username
=
sdl2_config
->
Get
(
"System"
,
"username"
,
"yuzu"
);
if
(
Settings
::
values
.
username
.
empty
())
{
Settings
::
values
.
username
=
"yuzu"
;
const
auto
size
=
sdl2_config
->
GetInteger
(
"System"
,
"users_size"
,
0
);
Settings
::
values
.
users
.
clear
();
for
(
std
::
size_t
i
=
0
;
i
<
size
;
++
i
)
{
const
auto
uuid_low
=
std
::
stoull
(
sdl2_config
->
Get
(
"System"
,
fmt
::
format
(
"users_{}_uuid_low"
,
i
),
"0"
),
nullptr
,
0
);
const
auto
uuid_high
=
std
::
stoull
(
sdl2_config
->
Get
(
"System"
,
fmt
::
format
(
"users_{}_uuid_high"
,
i
),
"0"
),
nullptr
,
0
);
Settings
::
values
.
users
.
emplace_back
(
sdl2_config
->
Get
(
"System"
,
fmt
::
format
(
"users_{}_username"
,
i
),
""
),
Service
::
Account
::
UUID
{
uuid_low
,
uuid_high
});
}
if
(
Settings
::
values
.
users
.
empty
())
{
Settings
::
values
.
users
.
emplace_back
(
"yuzu"
,
Service
::
Account
::
UUID
{
1
,
0
});
LOG_WARNING
(
Config
,
"You are using the default UUID of {1, 0}! This might cause issues down the road! "
"Please consider randomizing a UUID and adding it to the sdl2_config.ini file."
);
}
// Miscellaneous
...
...
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