Add Collapse All action to context menu of file system view

Task-number: QTCREATORBUG-19212
Change-Id: Ia8771a27dbcf77c956f013ed001c7890d6fe6e9a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Eike Ziller
2018-04-17 16:59:06 +02:00
parent 750df6dec5
commit dfd2dcb156

View File

@@ -771,22 +771,27 @@ void FolderNavigationWidget::contextMenuEvent(QContextMenuEvent *ev)
}
}
menu.addSeparator();
QAction * const collapseAllAction = menu.addAction(ProjectExplorerPlugin::tr("Collapse All"));
QAction *action = menu.exec(ev->globalPos());
if (!action)
return;
ev->accept();
if (action == actionOpenFile)
if (action == actionOpenFile) {
openItem(current);
else if (action == actionOpenAsProject)
} else if (action == actionOpenAsProject) {
ProjectExplorerPlugin::openProject(filePath.toString());
else if (action == actionOpenProjects)
} else if (action == actionOpenProjects)
openProjectsInDirectory(current);
else if (action == newFolder) {
if (isDir)
createNewFolder(current);
else
createNewFolder(current.parent());
} else if (action == collapseAllAction) {
m_listView->collapseAll();
}
}