1
0
mirror of synced 2024-11-24 15:50:16 +01:00

impr: Only auto backup if there's something to backup

This commit is contained in:
WerWolv 2023-12-22 21:16:09 +01:00
parent b934ca6ad3
commit ec64952cb4

View File

@ -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))