forked from qt-creator/qt-creator
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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user