MCPcopy Create free account
hub / github.com/XorTroll/Goldleaf / ExportSelectedUserIcon

Function ExportSelectedUserIcon

Goldleaf/source/acc/acc_UserSelection.cpp:139–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137 }
138
139 void ExportSelectedUserIcon() {
140 AccountProfile prof;
141 if(R_SUCCEEDED(accountGetProfile(&prof, g_SelectedUser))) {
142 u32 icon_size = 0;
143 accountProfileGetImageSize(&prof, &icon_size);
144 if(icon_size > 0) {
145 auto icon = new u8[icon_size]();
146 u32 tmp_size = 0;
147 if(R_SUCCEEDED(accountProfileLoadImage(&prof, icon, icon_size, &tmp_size))) {
148 const auto icon_path = GetExportedUserIcon();
149 auto sd_exp = fs::GetSdCardExplorer();
150 sd_exp->DeleteFile(icon_path);
151 sd_exp->WriteFile(icon_path, icon, icon_size);
152 }
153 delete[] icon;
154 }
155 accountProfileClose(&prof);
156 }
157 }
158
159 std::string GetExportedUserIcon() {
160 auto sd_exp = fs::GetSdCardExplorer();

Callers 3

mainFunction · 0.85
LoadMethod · 0.85
PickUserMethod · 0.85

Calls 4

GetExportedUserIconFunction · 0.85
GetSdCardExplorerFunction · 0.85
DeleteFileMethod · 0.45
WriteFileMethod · 0.45

Tested by

no test coverage detected