mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-16 16:35:46 -04:00
Qt: Add Clear and Reset buttons to cheat manager
This commit is contained in:
@ -607,10 +607,16 @@ CheatList::Format CheatList::DetectFileFormat(const std::string& str)
|
||||
|
||||
bool CheatList::LoadFromFile(const char* filename, Format format)
|
||||
{
|
||||
std::optional<std::string> str = FileSystem::ReadFileToString(filename);
|
||||
if (!str.has_value() || str->empty())
|
||||
if (!FileSystem::FileExists(filename))
|
||||
return false;
|
||||
|
||||
std::optional<std::string> str = FileSystem::ReadFileToString(filename);
|
||||
if (!str.has_value())
|
||||
return false;
|
||||
|
||||
if (str->empty())
|
||||
return true;
|
||||
|
||||
return LoadFromString(str.value(), format);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user