mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-27 04:36:18 +00:00
updater: flush log after each write
This commit is contained in:
parent
804b94ee9e
commit
de0bc06856
5 changed files with 72 additions and 65 deletions
|
@ -140,8 +140,7 @@ void UI::Init()
|
|||
}
|
||||
|
||||
bool Platform::VersionCheck(const std::vector<TodoList::UpdateOp>& to_update,
|
||||
const std::string& install_base_path, const std::string& temp_dir,
|
||||
FILE* log_fp)
|
||||
const std::string& install_base_path, const std::string& temp_dir)
|
||||
{
|
||||
const auto op_it = std::find_if(to_update.cbegin(), to_update.cend(), [&](const auto& op) {
|
||||
return op.filename == "Dolphin.app/Contents/Info.plist";
|
||||
|
@ -155,7 +154,7 @@ bool Platform::VersionCheck(const std::vector<TodoList::UpdateOp>& to_update,
|
|||
NSData* data = [NSData dataWithContentsOfFile:[NSString stringWithCString:plist_path.c_str()]];
|
||||
if (!data)
|
||||
{
|
||||
fprintf(log_fp, "Failed to read %s, skipping platform version check.\n", plist_path.c_str());
|
||||
LogToFile("Failed to read %s, skipping platform version check.\n", plist_path.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -167,13 +166,13 @@ bool Platform::VersionCheck(const std::vector<TodoList::UpdateOp>& to_update,
|
|||
error:&error];
|
||||
if (error)
|
||||
{
|
||||
fprintf(log_fp, "Failed to parse %s, skipping platform version check.\n", plist_path.c_str());
|
||||
LogToFile("Failed to parse %s, skipping platform version check.\n", plist_path.c_str());
|
||||
return true;
|
||||
}
|
||||
NSString* min_version_str = info_dict[@"LSMinimumSystemVersion"];
|
||||
if (!min_version_str)
|
||||
{
|
||||
fprintf(log_fp, "LSMinimumSystemVersion key missing, skipping platform version check.\n");
|
||||
LogToFile("LSMinimumSystemVersion key missing, skipping platform version check.\n");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -181,9 +180,8 @@ bool Platform::VersionCheck(const std::vector<TodoList::UpdateOp>& to_update,
|
|||
NSOperatingSystemVersion next_version{
|
||||
[components[0] integerValue], [components[1] integerValue], [components[2] integerValue]};
|
||||
|
||||
fprintf(log_fp, "Platform version check: next_version=%ld.%ld.%ld\n",
|
||||
(long)next_version.majorVersion, (long)next_version.minorVersion,
|
||||
(long)next_version.patchVersion);
|
||||
LogToFile("Platform version check: next_version=%ld.%ld.%ld\n", (long)next_version.majorVersion,
|
||||
(long)next_version.minorVersion, (long)next_version.patchVersion);
|
||||
|
||||
if (![[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:next_version])
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue