[qet] [1220] Circumvented the loading problem that occured on Windows.

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


Revision: 1220
Author:   xavier
Date:     2011-03-20 04:13:32 +0100 (Sun, 20 Mar 2011)
Log Message:
-----------
Circumvented the loading problem that occured on Windows.

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

Modified: branches/0.3/sources/elementspanel.cpp
===================================================================
--- branches/0.3/sources/elementspanel.cpp	2011-03-18 07:29:37 UTC (rev 1219)
+++ branches/0.3/sources/elementspanel.cpp	2011-03-20 03:13:32 UTC (rev 1220)
@@ -86,7 +86,8 @@
 	QTreeWidget(parent),
 	common_collection_item_(0),
 	custom_collection_item_(0),
-	first_activation_(true)
+	first_activation_(true),
+	first_reload_(true)
 {
 	
 	// selection unique
@@ -544,7 +545,7 @@
 */
 bool ElementsPanel::event(QEvent *event) {
 	if (first_activation_ && event -> type() == QEvent::WindowActivate) {
-		reload(false);
+		QTimer::singleShot(250, this, SLOT(reload()));
 		first_activation_ = false;
 	}
 	return(QTreeWidget::event(event));
@@ -802,7 +803,8 @@
 	custom_collection_item_ = addCollection(invisibleRootItem(), QETApp::customElementsCollection(), tr("Collection utilisateur"), QIcon(":/ico/16x16/go-home.png"));
 	
 	// the first time, expand the first level of collections
-	if (first_activation_) {
+	if (first_reload_) {
+		first_reload_ = true;
 		common_collection_item_ -> setExpanded(true);
 		custom_collection_item_ -> setExpanded(true);
 	}

Modified: branches/0.3/sources/elementspanel.h
===================================================================
--- branches/0.3/sources/elementspanel.h	2011-03-18 07:29:37 UTC (rev 1219)
+++ branches/0.3/sources/elementspanel.h	2011-03-20 03:13:32 UTC (rev 1220)
@@ -143,5 +143,6 @@
 	QTreeWidgetItem *custom_collection_item_;
 	int loading_progress_;
 	bool first_activation_;
+	bool first_reload_;
 };
 #endif


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