| 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(); |
no test coverage detected