Skip to content

Commit a29465d

Browse files
JWWTSLlzwind
authored andcommitted
fix: update save state
log: Remove premature _dirty=0 assignments before save calls so that setDirty(false) can properly emit dirtyChanged after a successful save, allowing the tab title * prefix to be cleared. pms: bug-364361
1 parent f72633d commit a29465d

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/drawshape/cdrawparamsigleton.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2020 - 2026 UnionTech Software Technology Co., Ltd.
22
//
33
// SPDX-License-Identifier: GPL-3.0-or-later
44

@@ -258,11 +258,9 @@ bool PageContext::save(const QString &file)
258258
QFileInfo info(filePath);
259259
if ("ddf" == info.suffix().toLower()) {
260260
qDebug() << "Saving as DDF file";
261-
_dirty = 0;
262261
rs = page()->borad()->fileHander()->saveToDdf(this, filePath);
263262
} else {
264263
qDebug() << "Saving as image file";
265-
_dirty = 0;
266264
rs = page()->borad()->fileHander()->saveToImage(this, filePath);
267265
//保存成功
268266
if (rs) {

src/frame/ccentralwidget.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,8 @@ bool Page::save(const QString &file)
560560
result = save(anotherFile);
561561
}
562562
}
563+
} else {
564+
borad()->setPageTitle(this, this->title());
563565
}
564566

565567
return result;
@@ -1187,7 +1189,6 @@ void DrawBoard::loadFiles(QStringList filePaths, bool bInThread, int loadTypeFo
11871189
addPage("");
11881190
currentPage()->setPageRect(QRectF(QPointF(0, 0), img.size()));
11891191
currentPage()->setFile(path);
1190-
currentPage()->context()->setDirty(false);
11911192
bNewPage = true;
11921193
}
11931194

@@ -1213,6 +1214,9 @@ void DrawBoard::loadFiles(QStringList filePaths, bool bInThread, int loadTypeFo
12131214
currentPage()->context()->addImage(img, pos, rect, !bNewPage, true);
12141215
}
12151216
}
1217+
1218+
if (bNewPage)
1219+
currentPage()->context()->setDirty(false);
12161220
}, connectType);
12171221
}
12181222
}

0 commit comments

Comments
 (0)