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
This commit is contained in:
xavier
2011-05-10 11:39:28 +00:00
parent b536c0998b
commit 6ee9f2ffa4

View File

@@ -797,17 +797,19 @@ void ElementsPanel::reload(bool reload_collections) {
emit(loadingProgressed(loading_progress_ = 0, items_count)); emit(loadingProgressed(loading_progress_ = 0, items_count));
// chargement des elements de la collection QET // chargement des elements de la collection QET
if (QETApp::commonElementsCollection()->rootCategory()) {
common_collection_item_ = addCollection(invisibleRootItem(), QETApp::commonElementsCollection(), tr("Collection QET"), QIcon(":/ico/16x16/qet.png")); 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 // chargement des elements de la collection utilisateur
if (QETApp::customElementsCollection()->rootCategory()) {
custom_collection_item_ = addCollection(invisibleRootItem(), QETApp::customElementsCollection(), tr("Collection utilisateur"), QIcon(":/ico/16x16/go-home.png")); 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 // the first time, expand the first level of collections
if (first_reload_) { if (first_reload_) first_reload_ = false;
first_reload_ = true;
common_collection_item_ -> setExpanded(true);
custom_collection_item_ -> setExpanded(true);
}
// chargement des projets // chargement des projets
foreach(QETProject *project, projects_to_display_.values()) { foreach(QETProject *project, projects_to_display_.values()) {