From 6ee9f2ffa4d74d39037180fd19f94f0ed4ed0cee Mon Sep 17 00:00:00 2001 From: xavier Date: Tue, 10 May 2011 11:39:28 +0000 Subject: [PATCH] Slightly improved behaviour when the common collection directory is not available. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1277 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- sources/elementspanel.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/sources/elementspanel.cpp b/sources/elementspanel.cpp index 31d2e9948..3fdf017e2 100644 --- a/sources/elementspanel.cpp +++ b/sources/elementspanel.cpp @@ -797,17 +797,19 @@ void ElementsPanel::reload(bool reload_collections) { emit(loadingProgressed(loading_progress_ = 0, items_count)); // chargement des elements de la collection QET - common_collection_item_ = addCollection(invisibleRootItem(), QETApp::commonElementsCollection(), tr("Collection QET"), QIcon(":/ico/16x16/qet.png")); + if (QETApp::commonElementsCollection()->rootCategory()) { + common_collection_item_ = addCollection(invisibleRootItem(), QETApp::commonElementsCollection(), tr("Collection QET"), QIcon(":/ico/16x16/qet.png")); + if (first_reload_) common_collection_item_ -> setExpanded(true); + } // chargement des elements de la collection utilisateur - custom_collection_item_ = addCollection(invisibleRootItem(), QETApp::customElementsCollection(), tr("Collection utilisateur"), QIcon(":/ico/16x16/go-home.png")); + if (QETApp::customElementsCollection()->rootCategory()) { + custom_collection_item_ = addCollection(invisibleRootItem(), QETApp::customElementsCollection(), tr("Collection utilisateur"), QIcon(":/ico/16x16/go-home.png")); + if (first_reload_) custom_collection_item_ -> setExpanded(true); + } // the first time, expand the first level of collections - if (first_reload_) { - first_reload_ = true; - common_collection_item_ -> setExpanded(true); - custom_collection_item_ -> setExpanded(true); - } + if (first_reload_) first_reload_ = false; // chargement des projets foreach(QETProject *project, projects_to_display_.values()) {