Simplify how the diagrams are saved

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4927 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2017-03-05 13:10:47 +00:00
parent 878e3d5bf0
commit 34d7d134d3
6 changed files with 39 additions and 116 deletions

View File

@@ -297,10 +297,6 @@ int ProjectView::tryClosingDiagrams() {
| QMessageBox::Cancel,
QMessageBox::Save);
if (close_dialog == QMessageBox::Save) {
saveDiagrams(project()->diagrams());
}
return(close_dialog);
}
@@ -708,9 +704,6 @@ QETResult ProjectView::doSave()
return(saveAs());
}
// look for diagrams matching the required save options
saveDiagrams(m_project->diagrams());
// write to file
QETResult result = m_project -> write();
updateWindowTitle();
@@ -718,22 +711,6 @@ QETResult ProjectView::doSave()
return(result);
}
/**
Save \a diagrams without emitting the written() signal and without writing
the project file itself.
*/
void ProjectView::saveDiagrams(const QList<Diagram *> &diagrams) {
foreach (Diagram *diagram, diagrams) {
// Diagram::write() emits the written() signal, which is connected
// to QETProject::write() through QETProject::componentWritten().
// We do not want to write the project immediately, so we block
// this signal.
diagram -> blockSignals(true);
diagram -> write();
diagram -> blockSignals(false);
}
}
/**
Allow the user to clean the project, which includes:
* deleting unused title block templates