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