[qet] [3523] clean some code

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 3523
Author:   blacksun
Date:     2014-11-27 18:57:10 +0100 (Thu, 27 Nov 2014)
Log Message:
-----------
clean some code

Modified Paths:
--------------
    trunk/sources/projectview.cpp
    trunk/sources/projectview.h

Modified: trunk/sources/projectview.cpp
===================================================================
--- trunk/sources/projectview.cpp	2014-11-27 17:47:01 UTC (rev 3522)
+++ trunk/sources/projectview.cpp	2014-11-27 17:57:10 UTC (rev 3523)
@@ -113,13 +113,6 @@
 		}
 	}
 	
-	if (options & ModifiedDiagramsOnly) {
-		foreach (Diagram *diagram, selection) {
-			if (!diagram -> undoStack().isClean() || !diagram -> wasWritten()) continue;
-			selection.removeOne(diagram);
-		}
-	}
-	
 	return(selection);
 }
 
@@ -371,21 +364,17 @@
 	// verifie que le schema est bien present dans le projet
 	if (!diagram_ids_.values().contains(diagram_view)) return;
 	
-	// demande confirmation a l'utilisateur
-	if (
-		diagram_view -> diagram() -> wasWritten() ||\
-		!diagram_view -> diagram() -> undoStack().isClean()
-	) {
-		int answer = QET::MessageBox::question(
-			this,
-			tr("Supprimer le sch\351ma ?", "message box title"),
-			tr("\312tes-vous s\373r de vouloir supprimer ce sch\351ma du projet ? Ce changement est irr\351versible.", "message box content"),
-			QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,
-			QMessageBox::No
-		);
-		if (answer != QMessageBox::Yes) {
-			return;
-		}
+
+	//Ask confirmation to user.
+	int answer = QET::MessageBox::question(
+		this,
+		tr("Supprimer le sch\351ma ?", "message box title"),
+		tr("\312tes-vous s\373r de vouloir supprimer ce sch\351ma du projet ? Ce changement est irr\351versible.", "message box content"),
+		QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,
+		QMessageBox::No
+	);
+	if (answer != QMessageBox::Yes) {
+		return;
 	}
 	
 	// enleve le DiagramView des onglets

Modified: trunk/sources/projectview.h
===================================================================
--- trunk/sources/projectview.h	2014-11-27 17:47:01 UTC (rev 3522)
+++ trunk/sources/projectview.h	2014-11-27 17:57:10 UTC (rev 3523)
@@ -34,7 +34,6 @@
 	
 	public:
 	enum ProjectSaveOption {
-		ModifiedDiagramsOnly = 1,
 		CurrentDiagram = 2,
 		AllDiagramsButCurrent = 4,
 		AllDiagrams = 6
@@ -77,7 +76,7 @@
 	void printProject();
 	void exportProject();
 	QETResult save();
-	QETResult saveAs(ProjectSaveOptions = ProjectSaveOptions(AllDiagrams | ModifiedDiagramsOnly));
+	QETResult saveAs(ProjectSaveOptions = ProjectSaveOptions(AllDiagrams));
 	QETResult doSave(ProjectSaveOptions);
 	void saveDiagrams(const QList<Diagram *> &);
 	int cleanProject();


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/