Merge pull request #8621 from unknownbrackets/savestates

Avoid reloading save info on move/resize
This commit is contained in:
Henrik Rydgård 2016-03-05 23:05:23 +01:00
commit a8907cb172
2 changed files with 8 additions and 6 deletions

View File

@ -273,11 +273,6 @@ SavedataBrowser::SavedataBrowser(std::string path, UI::LayoutParams *layoutParam
Refresh();
}
SavedataBrowser::~SavedataBrowser() {
g_gameInfoCache->PurgeType(FILETYPE_PPSSPP_SAVESTATE);
g_gameInfoCache->PurgeType(FILETYPE_PSP_SAVEDATA_DIRECTORY);
}
void SavedataBrowser::Refresh() {
using namespace UI;
@ -338,6 +333,13 @@ UI::EventReturn SavedataBrowser::SavedataButtonClick(UI::EventParams &e) {
SavedataScreen::SavedataScreen(std::string gamePath) : UIDialogScreenWithGameBackground(gamePath) {
}
SavedataScreen::~SavedataScreen() {
if (g_gameInfoCache) {
g_gameInfoCache->PurgeType(FILETYPE_PPSSPP_SAVESTATE);
g_gameInfoCache->PurgeType(FILETYPE_PSP_SAVEDATA_DIRECTORY);
}
}
void SavedataScreen::CreateViews() {
using namespace UI;
I18NCategory *sa = GetI18NCategory("Savedata");

View File

@ -29,7 +29,6 @@
class SavedataBrowser : public UI::LinearLayout {
public:
SavedataBrowser(std::string path, UI::LayoutParams *layoutParams = 0);
~SavedataBrowser();
UI::Event OnChoice;
@ -45,6 +44,7 @@ class SavedataScreen : public UIDialogScreenWithGameBackground {
public:
// gamePath can be empty, in that case this screen will show all savedata in the save directory.
SavedataScreen(std::string gamePath);
~SavedataScreen();
void dialogFinished(const Screen *dialog, DialogResult result) override;