diff options
| author | 2020-08-15 08:33:16 -0400 | |
|---|---|---|
| committer | 2020-08-16 06:52:40 -0400 | |
| commit | c4ed791164df7e3e74042a37a62077b4dc4ade91 (patch) | |
| tree | 12bbcc09d0db32a0b6b5dc1bc49245964486da63 /src/core/telemetry_session.cpp | |
| parent | Merge pull request #4528 from lioncash/discard (diff) | |
| download | yuzu-c4ed791164df7e3e74042a37a62077b4dc4ade91.tar.gz yuzu-c4ed791164df7e3e74042a37a62077b4dc4ade91.tar.xz yuzu-c4ed791164df7e3e74042a37a62077b4dc4ade91.zip | |
common/fileutil: Convert namespace to Common::FS
Migrates a remaining common file over to the Common namespace, making it
consistent with the rest of common files.
This also allows for high-traffic FS related code to alias the
filesystem function namespace as
namespace FS = Common::FS;
for more concise typing.
Diffstat (limited to 'src/core/telemetry_session.cpp')
| -rw-r--r-- | src/core/telemetry_session.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index 5a30c75da..7dae48bc6 100644 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp | |||
| @@ -70,12 +70,12 @@ static const char* TranslateGPUAccuracyLevel(Settings::GPUAccuracy backend) { | |||
| 70 | 70 | ||
| 71 | u64 GetTelemetryId() { | 71 | u64 GetTelemetryId() { |
| 72 | u64 telemetry_id{}; | 72 | u64 telemetry_id{}; |
| 73 | const std::string filename{FileUtil::GetUserPath(FileUtil::UserPath::ConfigDir) + | 73 | const std::string filename{Common::FS::GetUserPath(Common::FS::UserPath::ConfigDir) + |
| 74 | "telemetry_id"}; | 74 | "telemetry_id"}; |
| 75 | 75 | ||
| 76 | bool generate_new_id = !FileUtil::Exists(filename); | 76 | bool generate_new_id = !Common::FS::Exists(filename); |
| 77 | if (!generate_new_id) { | 77 | if (!generate_new_id) { |
| 78 | FileUtil::IOFile file(filename, "rb"); | 78 | Common::FS::IOFile file(filename, "rb"); |
| 79 | if (!file.IsOpen()) { | 79 | if (!file.IsOpen()) { |
| 80 | LOG_ERROR(Core, "failed to open telemetry_id: {}", filename); | 80 | LOG_ERROR(Core, "failed to open telemetry_id: {}", filename); |
| 81 | return {}; | 81 | return {}; |
| @@ -88,7 +88,7 @@ u64 GetTelemetryId() { | |||
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | if (generate_new_id) { | 90 | if (generate_new_id) { |
| 91 | FileUtil::IOFile file(filename, "wb"); | 91 | Common::FS::IOFile file(filename, "wb"); |
| 92 | if (!file.IsOpen()) { | 92 | if (!file.IsOpen()) { |
| 93 | LOG_ERROR(Core, "failed to open telemetry_id: {}", filename); | 93 | LOG_ERROR(Core, "failed to open telemetry_id: {}", filename); |
| 94 | return {}; | 94 | return {}; |
| @@ -102,10 +102,10 @@ u64 GetTelemetryId() { | |||
| 102 | 102 | ||
| 103 | u64 RegenerateTelemetryId() { | 103 | u64 RegenerateTelemetryId() { |
| 104 | const u64 new_telemetry_id{GenerateTelemetryId()}; | 104 | const u64 new_telemetry_id{GenerateTelemetryId()}; |
| 105 | const std::string filename{FileUtil::GetUserPath(FileUtil::UserPath::ConfigDir) + | 105 | const std::string filename{Common::FS::GetUserPath(Common::FS::UserPath::ConfigDir) + |
| 106 | "telemetry_id"}; | 106 | "telemetry_id"}; |
| 107 | 107 | ||
| 108 | FileUtil::IOFile file(filename, "wb"); | 108 | Common::FS::IOFile file(filename, "wb"); |
| 109 | if (!file.IsOpen()) { | 109 | if (!file.IsOpen()) { |
| 110 | LOG_ERROR(Core, "failed to open telemetry_id: {}", filename); | 110 | LOG_ERROR(Core, "failed to open telemetry_id: {}", filename); |
| 111 | return {}; | 111 | return {}; |