[qet] [2401] element editor bugfix: after reload element, add a primitive crash qet

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


Revision: 2401
Author:   blacksun
Date:     2013-07-28 23:55:02 +0200 (Sun, 28 Jul 2013)
Log Message:
-----------
element editor bugfix: after reload element, add a primitive crash qet

Modified Paths:
--------------
    trunk/sources/editor/elementscene.cpp
    trunk/sources/editor/qetelementeditor.cpp

Modified: trunk/sources/editor/elementscene.cpp
===================================================================
--- trunk/sources/editor/elementscene.cpp	2013-07-28 14:42:24 UTC (rev 2400)
+++ trunk/sources/editor/elementscene.cpp	2013-07-28 21:55:02 UTC (rev 2401)
@@ -1048,8 +1048,8 @@
 	undoStack().clear();
 	// enleve les elements de la scene
 	foreach (QGraphicsItem *qgi, items()) {
+		qgiManager().release(qgi);
 		removeItem(qgi);
-		qgiManager().release(qgi);
 	}
 }
 

Modified: trunk/sources/editor/qetelementeditor.cpp
===================================================================
--- trunk/sources/editor/qetelementeditor.cpp	2013-07-28 14:42:24 UTC (rev 2400)
+++ trunk/sources/editor/qetelementeditor.cpp	2013-07-28 21:55:02 UTC (rev 2401)
@@ -184,7 +184,7 @@
 	open_file         -> setShortcut(tr("Ctrl+Shift+O"));
 	save              -> setShortcut(QKeySequence::Save);
 	save_as_file      -> setShortcut(tr("Ctrl+Shift+S"));
-	//reload            -> setShortcut(Qt::Key_F5);
+	reload            -> setShortcut(Qt::Key_F5);
 	quit              -> setShortcut(QKeySequence(tr("Ctrl+Q")));
 	selectall         -> setShortcut(QKeySequence::SelectAll);
 	deselectall       -> setShortcut(QKeySequence(tr("Ctrl+Shift+A")));
@@ -313,7 +313,7 @@
 	main_toolbar -> addAction(open);
 	main_toolbar -> addAction(save);
 	main_toolbar -> addAction(save_as);
-	//main_toolbar -> addAction(reload);
+	main_toolbar -> addAction(reload);
 	main_toolbar -> addSeparator();
 	main_toolbar -> addAction(undo);
 	main_toolbar -> addAction(redo);
@@ -373,7 +373,7 @@
 	file_menu    -> addAction(save_as);
 	file_menu    -> addAction(save_as_file);
 	file_menu    -> addSeparator();
-	//file_menu    -> addAction(reload);
+	file_menu    -> addAction(reload);
 	file_menu    -> addSeparator();
 	file_menu    -> addAction(quit);
 	
@@ -953,7 +953,6 @@
 	}
 	
 	// recharge l'element
-	//TODO disable reload action because after action element is not editable next
 	if (opened_from_file) {
 		// l'element a ete ouvert a partir d'un chemin de fichier
 		ce_scene -> reset();
@@ -977,7 +976,7 @@
 */
 bool QETElementEditor::slot_save() {
 	// verification avant d'enregistrer le fichier
-	//checkElement();
+	checkElement();
 	// si on ne connait pas le nom du fichier en cours, enregistrer revient a enregistrer sous
 	if (opened_from_file) {
 		if (filename_.isEmpty()) return(slot_saveAsFile());


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