+ if (activatedAction == expandableFoldersAction) {
+ const bool expand = expandableFoldersAction->isChecked();
+ if (!expand) {
+ // collapse all expanded folders, as QTreeView::setItemsExpandable(false)
+ // does not do this task
+ const int rowCount = model()->rowCount();
+ for (int row = 0; row < rowCount; ++row) {
+ setExpanded(model()->index(row, 0), false);
+ }
+ }
+ settings->setExpandableFolders(expand);
+ setRootIsDecorated(expand);
+ setItemsExpandable(expand);
+ } else if (activatedAction != 0) {