| 356 | } |
| 357 | |
| 358 | void RestoreConfigFromBackup(const std::string& backupFilename, const std::string& destinationFilename) { |
| 359 | std::string sourcePath = "meta\\" + backupFilename; |
| 360 | std::string destinationPath = destinationFilename; |
| 361 | |
| 362 | if (CopyFile(sourcePath.c_str(), destinationPath.c_str(), FALSE)) { |
| 363 | MessageBox(NULL, TEXT("Default config restored from backup successfully."), TEXT("SnapKey"), MB_ICONINFORMATION | MB_OK); |
| 364 | } else { |
| 365 | MessageBox(NULL, TEXT("Failed to restore config from backup."), TEXT("SnapKey Error"), MB_ICONERROR | MB_OK); |
| 366 | } |
| 367 | } |
| 368 | |
| 369 | void CreateDefaultConfig(const std::string& filename) { |
| 370 | RestoreConfigFromBackup("backup.snapkey", filename); |
no outgoing calls
no test coverage detected