mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
ux: Only save a crash backup when there actually were any changes
This commit is contained in:
@@ -190,6 +190,9 @@ namespace hex {
|
||||
constexpr auto CrashBackupFileName = "crash_backup.hexproj";
|
||||
|
||||
EventManager::subscribe<EventAbnormalTermination>(this, [CrashBackupFileName](int signal) {
|
||||
if (!ProjectFile::hasUnsavedChanges())
|
||||
return;
|
||||
|
||||
for (const auto &path : hex::getPath(ImHexPath::Config)) {
|
||||
if (ProjectFile::store((std::filesystem::path(path) / CrashBackupFileName).string()))
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user