mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-04-10 19:15:13 +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;
|
mIsEditingCustom = false;
|
||||||
mEditingCollection = "Favorites";
|
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();
|
mEditingCollectionSystemData->system->onMetaDataSavePoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -902,7 +909,11 @@ void CollectionSystemsManager::reactivateCustomCollectionEntry(FileData* game)
|
||||||
it != mCustomCollectionSystemsData.cend(); it++) {
|
it != mCustomCollectionSystemsData.cend(); it++) {
|
||||||
std::string path = getCustomCollectionConfigPath(it->first);
|
std::string path = getCustomCollectionConfigPath(it->first);
|
||||||
if (Utils::FileSystem::exists(path)) {
|
if (Utils::FileSystem::exists(path)) {
|
||||||
|
#if defined(_WIN64)
|
||||||
|
std::ifstream input(Utils::String::stringToWideString(path).c_str());
|
||||||
|
#else
|
||||||
std::ifstream input(path);
|
std::ifstream input(path);
|
||||||
|
#endif
|
||||||
for (std::string gameKey; getline(input, gameKey);) {
|
for (std::string gameKey; getline(input, gameKey);) {
|
||||||
if (gameKey == gamePath) {
|
if (gameKey == gamePath) {
|
||||||
setEditMode(it->first, false);
|
setEditMode(it->first, false);
|
||||||
|
|
@ -1043,7 +1054,7 @@ void CollectionSystemsManager::populateCustomCollection(CollectionSystemData* sy
|
||||||
FileFilterIndex* index = newSys->getIndex();
|
FileFilterIndex* index = newSys->getIndex();
|
||||||
|
|
||||||
// Get configuration for this custom collection.
|
// Get configuration for this custom collection.
|
||||||
#if _WIN64
|
#if defined (_WIN64)
|
||||||
std::ifstream input(Utils::String::stringToWideString(path).c_str());
|
std::ifstream input(Utils::String::stringToWideString(path).c_str());
|
||||||
#else
|
#else
|
||||||
std::ifstream input(path);
|
std::ifstream input(path);
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,8 @@
|
||||||
#include "guis/GuiMsgBox.h"
|
#include "guis/GuiMsgBox.h"
|
||||||
#include "guis/GuiSettings.h"
|
#include "guis/GuiSettings.h"
|
||||||
#include "guis/GuiTextEditPopup.h"
|
#include "guis/GuiTextEditPopup.h"
|
||||||
#include "views/gamelist/IGameListView.h"
|
|
||||||
#include "views/ViewController.h"
|
#include "views/ViewController.h"
|
||||||
#include "CollectionSystemsManager.h"
|
#include "CollectionSystemsManager.h"
|
||||||
#include "SystemData.h"
|
|
||||||
|
|
||||||
GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
|
GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
|
||||||
Window* window,
|
Window* window,
|
||||||
|
|
@ -34,11 +32,6 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
|
||||||
"' COLLECTION", Font::get(FONT_SIZE_MEDIUM), 0x777777FF), true);
|
"' COLLECTION", Font::get(FONT_SIZE_MEDIUM), 0x777777FF), true);
|
||||||
row.makeAcceptInputHandler([this] {
|
row.makeAcceptInputHandler([this] {
|
||||||
CollectionSystemsManager::get()->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);
|
|
||||||
}
|
|
||||||
mWindow->invalidateCachedBackground();
|
mWindow->invalidateCachedBackground();
|
||||||
delete this;
|
delete this;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -298,13 +298,6 @@ void GuiGamelistOptions::startEditMode()
|
||||||
void GuiGamelistOptions::exitEditMode()
|
void GuiGamelistOptions::exitEditMode()
|
||||||
{
|
{
|
||||||
CollectionSystemsManager::get()->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;
|
delete this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,8 @@ void Log::flush()
|
||||||
|
|
||||||
void Log::close()
|
void Log::close()
|
||||||
{
|
{
|
||||||
file.close();
|
if (file.is_open())
|
||||||
|
file.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
Log::~Log()
|
Log::~Log()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue