Skip to content

Commit

Permalink
Use QUndoStack clean instead if checking the backupElement ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
MrStevns committed Apr 17, 2024
1 parent e968d49 commit d5291fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core_lib/src/managers/backupmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Status BackupManager::load(Object* /*o*/)
Status BackupManager::save(Object* /*o*/)
{
if (mNewBackupSystemEnabled) {
mBackupAtSave = latestBackupElement();
mUndoStack->setClean();
} else {
mLegacyBackupAtSave = mLegacyBackupList[mLegacyBackupIndex];
}
Expand Down Expand Up @@ -137,7 +137,7 @@ const BackupElement* BackupManager::latestBackupElement() const
bool BackupManager::hasUnsavedChanges() const
{
if (mNewBackupSystemEnabled) {
return mBackupAtSave != latestBackupElement();
return !mUndoStack->isClean();
} else {
if (mLegacyBackupIndex >= 0) {
return mLegacyBackupAtSave != mLegacyBackupList[mLegacyBackupIndex];
Expand Down
2 changes: 0 additions & 2 deletions core_lib/src/managers/backupmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ class BackupManager : public BaseManager
QPointF mSelectionTranslation;
QPointF mSelectionAnchor;

const BackupElement* mBackupAtSave = nullptr;

// Legacy system
int mLegacyBackupIndex = -1;
LegacyBackupElement* mLegacyBackupAtSave = nullptr;
Expand Down

0 comments on commit d5291fa

Please sign in to comment.