mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-03-06 14:27:43 +00:00
Made re-enabling of custom collection entries work on Windows with UTF-16 support.
This commit is contained in:
parent
128056667d
commit
5e7480bfab
|
@ -610,6 +610,13 @@ void CollectionSystemsManager::exitEditMode(bool showPopup)
|
|||
mIsEditingCustom = false;
|
||||
mEditingCollection = "Favorites";
|
||||
|
||||
// Remove all tick marks from the games that are part of the collection.
|
||||
for (auto it = SystemData::sSystemVector.begin();
|
||||
it != SystemData::sSystemVector.end(); it++) {
|
||||
ViewController::get()->getGameListView((*it))->onFileChanged(
|
||||
ViewController::get()->getGameListView((*it))->getCursor(), false);
|
||||
}
|
||||
|
||||
mEditingCollectionSystemData->system->onMetaDataSavePoint();
|
||||
}
|
||||
|
||||
|
@ -902,7 +909,11 @@ void CollectionSystemsManager::reactivateCustomCollectionEntry(FileData* game)
|
|||
it != mCustomCollectionSystemsData.cend(); it++) {
|
||||
std::string path = getCustomCollectionConfigPath(it->first);
|
||||
if (Utils::FileSystem::exists(path)) {
|
||||
#if defined(_WIN64)
|
||||
std::ifstream input(Utils::String::stringToWideString(path).c_str());
|
||||
#else
|
||||
std::ifstream input(path);
|
||||
#endif
|
||||
for (std::string gameKey; getline(input, gameKey);) {
|
||||
if (gameKey == gamePath) {
|
||||
setEditMode(it->first, false);
|
||||
|
@ -1043,7 +1054,7 @@ void CollectionSystemsManager::populateCustomCollection(CollectionSystemData* sy
|
|||
FileFilterIndex* index = newSys->getIndex();
|
||||
|
||||
// Get configuration for this custom collection.
|
||||
#if _WIN64
|
||||
#if defined (_WIN64)
|
||||
std::ifstream input(Utils::String::stringToWideString(path).c_str());
|
||||
#else
|
||||
std::ifstream input(path);
|
||||
|
|
|
@ -14,10 +14,8 @@
|
|||
#include "guis/GuiMsgBox.h"
|
||||
#include "guis/GuiSettings.h"
|
||||
#include "guis/GuiTextEditPopup.h"
|
||||
#include "views/gamelist/IGameListView.h"
|
||||
#include "views/ViewController.h"
|
||||
#include "CollectionSystemsManager.h"
|
||||
#include "SystemData.h"
|
||||
|
||||
GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
|
||||
Window* window,
|
||||
|
@ -34,11 +32,6 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
|
|||
"' COLLECTION", Font::get(FONT_SIZE_MEDIUM), 0x777777FF), true);
|
||||
row.makeAcceptInputHandler([this] {
|
||||
CollectionSystemsManager::get()->exitEditMode();
|
||||
for (auto it = SystemData::sSystemVector.begin();
|
||||
it != SystemData::sSystemVector.end(); it++) {
|
||||
ViewController::get()->getGameListView((*it))->onFileChanged(
|
||||
ViewController::get()->getGameListView((*it))->getCursor(), false);
|
||||
}
|
||||
mWindow->invalidateCachedBackground();
|
||||
delete this;
|
||||
});
|
||||
|
|
|
@ -298,13 +298,6 @@ void GuiGamelistOptions::startEditMode()
|
|||
void GuiGamelistOptions::exitEditMode()
|
||||
{
|
||||
CollectionSystemsManager::get()->exitEditMode();
|
||||
|
||||
for (auto it = SystemData::sSystemVector.begin();
|
||||
it != SystemData::sSystemVector.end(); it++) {
|
||||
ViewController::get()->getGameListView((*it))->onFileChanged(
|
||||
ViewController::get()->getGameListView((*it))->getCursor(), false);
|
||||
}
|
||||
|
||||
delete this;
|
||||
}
|
||||
|
||||
|
|
|
@ -75,7 +75,8 @@ void Log::flush()
|
|||
|
||||
void Log::close()
|
||||
{
|
||||
file.close();
|
||||
if (file.is_open())
|
||||
file.close();
|
||||
}
|
||||
|
||||
Log::~Log()
|
||||
|
|
Loading…
Reference in a new issue