From ec64952cb4d8c92e013a2492d09189c1f581d004 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Fri, 22 Dec 2023 21:16:09 +0100 Subject: [PATCH] impr: Only auto backup if there's something to backup --- plugins/builtin/source/content/background_services.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/builtin/source/content/background_services.cpp b/plugins/builtin/source/content/background_services.cpp index 471489095..1ee4f71e0 100644 --- a/plugins/builtin/source/content/background_services.cpp +++ b/plugins/builtin/source/content/background_services.cpp @@ -69,7 +69,7 @@ namespace hex::plugin::builtin { if (autoBackupTime > 0 && (now - lastBackupTime) > std::chrono::seconds(autoBackupTime)) { lastBackupTime = now; - if (ImHexApi::Provider::isValid()) { + if (ImHexApi::Provider::isValid() && ImHexApi::Provider::isDirty()) { for (const auto &path : fs::getDefaultPaths(fs::ImHexPath::Backups)) { const auto fileName = hex::format("auto_backup.{:%y%m%d_%H%M%S}.hexproj", fmt::gmtime(std::chrono::system_clock::now())); if (ProjectFile::store(path / fileName, false))