Add Layout::setClean

This commit is contained in:
GriffinR
2025-03-02 19:27:25 -05:00
parent 7cfd9fa0f8
commit 36aac9304f
3 changed files with 7 additions and 1 deletions

View File

@@ -114,6 +114,7 @@ public:
void clearBorderCache();
void cacheBorder();
void setClean();
bool hasUnsavedChanges() const;
bool layoutBlockChanged(int i, const Blockdata &cache);

View File

@@ -437,6 +437,11 @@ QPixmap Layout::getLayoutItemPixmap() {
return this->layoutItem ? this->layoutItem->pixmap() : QPixmap();
}
void Layout::setClean() {
this->editHistory.setClean();
this->hasUnsavedDataChanges = false;
}
bool Layout::hasUnsavedChanges() const {
return !this->editHistory.isClean() || this->hasUnsavedDataChanges || !this->newFolderPath.isEmpty();
}

View File

@@ -1288,7 +1288,7 @@ void Project::saveLayout(Layout *layout) {
// Update global data structures with current map data.
updateLayout(layout);
layout->editHistory.setClean();
layout->setClean();
}
void Project::updateLayout(Layout *layout) {