mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user