From 36aac9304fc395c22203807b077dab12faddd3f3 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 2 Mar 2025 19:27:25 -0500 Subject: [PATCH] Add Layout::setClean --- include/core/maplayout.h | 1 + src/core/maplayout.cpp | 5 +++++ src/project.cpp | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/core/maplayout.h b/include/core/maplayout.h index c6231fee..604e2b3d 100644 --- a/include/core/maplayout.h +++ b/include/core/maplayout.h @@ -114,6 +114,7 @@ public: void clearBorderCache(); void cacheBorder(); + void setClean(); bool hasUnsavedChanges() const; bool layoutBlockChanged(int i, const Blockdata &cache); diff --git a/src/core/maplayout.cpp b/src/core/maplayout.cpp index 4fae085c..36eada7b 100644 --- a/src/core/maplayout.cpp +++ b/src/core/maplayout.cpp @@ -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(); } diff --git a/src/project.cpp b/src/project.cpp index 006e5b63..3ba99112 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -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) {