From 1a96f48370439181d4bb7db55e1e975a0f586e76 Mon Sep 17 00:00:00 2001 From: Juha Laukkanen Date: Tue, 8 Jul 2014 13:56:20 +0900 Subject: [PATCH] Put status of cheat.db import to log. Currently there is no any feedback to user. --- UI/CwCheatScreen.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/UI/CwCheatScreen.cpp b/UI/CwCheatScreen.cpp index ca46abfc6c..66cdb2a03d 100644 --- a/UI/CwCheatScreen.cpp +++ b/UI/CwCheatScreen.cpp @@ -190,6 +190,10 @@ UI::EventReturn CwCheatScreen::OnImportCheat(UI::EventParams ¶ms) { std::fstream fs; File::OpenCPPFile(fs, cheatFile, std::ios::in); + if (!fs.is_open()) { + WARN_LOG(COMMON, "Unable to open %s\n", cheatFile.c_str()); + } + while (fs.good()) { getline(fs, line); // get line from file if (line == "_S " + gameTitle.substr(0, 4) + "-" + gameTitle.substr(4)) { @@ -238,9 +242,12 @@ UI::EventReturn CwCheatScreen::OnImportCheat(UI::EventParams ¶ms) { if (title2.substr(0, 2) != "_S" && it != title.end() && (++it) != title.end()) { fs << title[0] << "\n" << title[1]; } + + NOTICE_LOG(COMMON, "Imported %lu entries from %s.\n", newList.size(), cheatFile.c_str()); if (newList.size() != 0) { fs << "\n"; } + for (int i = 0; i < (int)newList.size(); i++) { fs << newList[i]; if (i < (int)newList.size() - 1) {