mirror of
https://github.com/ocornut/imgui.git
synced 2026-07-09 02:49:39 +00:00
Settings: fixed Windows not honoring DiscardWhenMissingDate. (#9460)
This commit is contained in:
@@ -15904,9 +15904,10 @@ static void WindowSettingsHandler_Cleanup(ImGuiContext* ctx, ImGuiSettingsHandle
|
||||
ImGuiContext& g = *ctx;
|
||||
for (ImGuiWindowSettings* settings = g.SettingsWindows.begin(); settings != NULL; settings = g.SettingsWindows.next_chunk(settings))
|
||||
{
|
||||
if (args->_DiscardOlderThanDate != 0 && settings->LastUsedDate.Unpack() < args->_DiscardOlderThanDate)
|
||||
const bool is_valid = settings->LastUsedDate.IsValid();
|
||||
if ((args->_DiscardOlderThanDate != 0 && settings->LastUsedDate.Unpack() < args->_DiscardOlderThanDate) || (args->DiscardWhenMissingDate && !is_valid))
|
||||
settings->WantDelete = true;
|
||||
if (args->SetCurrentSessionDateToAll || (args->SetCurrentSessionDateWhenMissingDate && settings->LastUsedDate.IsValid() == false))
|
||||
if (args->SetCurrentSessionDateToAll || (args->SetCurrentSessionDateWhenMissingDate && !is_valid))
|
||||
settings->LastUsedDate = g.SessionDate;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user