[qet] [1498] The elements panel now checks that embedded collections exist before expanding them .

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


Revision: 1498
Author:   xavier
Date:     2012-02-12 17:47:37 +0100 (Sun, 12 Feb 2012)
Log Message:
-----------
The elements panel now checks that embedded collections exist before expanding them.

Modified Paths:
--------------
    branches/0.3/sources/elementspanel.cpp

Modified: branches/0.3/sources/elementspanel.cpp
===================================================================
--- branches/0.3/sources/elementspanel.cpp	2012-02-12 16:45:05 UTC (rev 1497)
+++ branches/0.3/sources/elementspanel.cpp	2012-02-12 16:47:37 UTC (rev 1498)
@@ -395,8 +395,19 @@
 		qtwi_project
 	);
 	qtwi_project -> setExpanded(true);
-	itemForTemplatesCollection(project -> embeddedTitleBlockTemplatesCollection()) -> setExpanded(true);
 	
+	if (TitleBlockTemplatesCollection *tbt_collection = project -> embeddedTitleBlockTemplatesCollection()) {
+		if (QTreeWidgetItem *tbt_collection_qtwi = itemForTemplatesCollection(tbt_collection)) {
+			tbt_collection_qtwi -> setExpanded(true);
+		}
+	}
+	
+	if (ElementsCollection *elmt_collection = project -> embeddedCollection()) {
+		if (QTreeWidgetItem *elmt_collection_qtwi = itemForElementsCollection(elmt_collection)) {
+			elmt_collection_qtwi -> setExpanded(true);
+		}
+	}
+	
 	return(qtwi_project);
 }
 
@@ -679,6 +690,7 @@
 void ElementsPanel::projectWasOpened(QETProject *project) {
 	projects_to_display_ << project;
 	addProject(project);
+	emit(panelContentChanged());
 }
 
 /**
@@ -690,6 +702,7 @@
 		GenericPanel::deleteItem(item_to_remove);
 		projects_to_display_.remove(project);
 	}
+	emit(panelContentChanged());
 }
 
 /**


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