forked from qt-creator/qt-creator
ProjectExplorer: Remove unnecessary dd->
Change-Id: If53a0c4d2b0e34a724ffeac1c3e489fb1240d176 Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
@@ -2765,12 +2765,12 @@ void ProjectExplorerPluginPrivate::updateContextMenuActions()
|
|||||||
|
|
||||||
if (ProjectNode *pn = dynamic_cast<ProjectNode *>(currentNode)) {
|
if (ProjectNode *pn = dynamic_cast<ProjectNode *>(currentNode)) {
|
||||||
if (ProjectTree::currentProject() && pn == ProjectTree::currentProject()->rootProjectNode()) {
|
if (ProjectTree::currentProject() && pn == ProjectTree::currentProject()->rootProjectNode()) {
|
||||||
dd->m_runActionContextMenu->setVisible(true);
|
m_runActionContextMenu->setVisible(true);
|
||||||
} else {
|
} else {
|
||||||
QList<RunConfiguration *> runConfigs = pn->runConfigurations();
|
QList<RunConfiguration *> runConfigs = pn->runConfigurations();
|
||||||
if (runConfigs.count() == 1) {
|
if (runConfigs.count() == 1) {
|
||||||
dd->m_runActionContextMenu->setVisible(true);
|
m_runActionContextMenu->setVisible(true);
|
||||||
dd->m_runActionContextMenu->setData(QVariant::fromValue(runConfigs.first()));
|
m_runActionContextMenu->setData(QVariant::fromValue(runConfigs.first()));
|
||||||
} else if (runConfigs.count() > 1) {
|
} else if (runConfigs.count() > 1) {
|
||||||
runMenu->menu()->menuAction()->setVisible(true);
|
runMenu->menu()->menuAction()->setVisible(true);
|
||||||
foreach (RunConfiguration *rc, runConfigs) {
|
foreach (RunConfiguration *rc, runConfigs) {
|
||||||
@@ -2786,16 +2786,16 @@ void ProjectExplorerPluginPrivate::updateContextMenuActions()
|
|||||||
}
|
}
|
||||||
if (dynamic_cast<FolderNode*>(currentNode)) {
|
if (dynamic_cast<FolderNode*>(currentNode)) {
|
||||||
// Also handles ProjectNode
|
// Also handles ProjectNode
|
||||||
dd->m_addNewFileAction->setEnabled(actions.contains(AddNewFile)
|
m_addNewFileAction->setEnabled(actions.contains(AddNewFile)
|
||||||
&& !ICore::isNewItemDialogRunning());
|
&& !ICore::isNewItemDialogRunning());
|
||||||
dd->m_addNewSubprojectAction->setEnabled(currentNode->nodeType() == ProjectNodeType
|
m_addNewSubprojectAction->setEnabled(currentNode->nodeType() == ProjectNodeType
|
||||||
&& actions.contains(AddSubProject)
|
&& actions.contains(AddSubProject)
|
||||||
&& !ICore::isNewItemDialogRunning());
|
&& !ICore::isNewItemDialogRunning());
|
||||||
dd->m_removeProjectAction->setEnabled(currentNode->nodeType() == ProjectNodeType
|
m_removeProjectAction->setEnabled(currentNode->nodeType() == ProjectNodeType
|
||||||
&& actions.contains(RemoveSubProject));
|
&& actions.contains(RemoveSubProject));
|
||||||
dd->m_addExistingFilesAction->setEnabled(actions.contains(AddExistingFile));
|
m_addExistingFilesAction->setEnabled(actions.contains(AddExistingFile));
|
||||||
dd->m_addExistingDirectoryAction->setEnabled(actions.contains(AddExistingDirectory));
|
m_addExistingDirectoryAction->setEnabled(actions.contains(AddExistingDirectory));
|
||||||
dd->m_renameFileAction->setEnabled(actions.contains(Rename));
|
m_renameFileAction->setEnabled(actions.contains(Rename));
|
||||||
} else if (dynamic_cast<FileNode*>(currentNode)) {
|
} else if (dynamic_cast<FileNode*>(currentNode)) {
|
||||||
// Enable and show remove / delete in magic ways:
|
// Enable and show remove / delete in magic ways:
|
||||||
// If both are disabled show Remove
|
// If both are disabled show Remove
|
||||||
@@ -2803,34 +2803,34 @@ void ProjectExplorerPluginPrivate::updateContextMenuActions()
|
|||||||
// If only removeFile is enabled only show it
|
// If only removeFile is enabled only show it
|
||||||
// If only deleteFile is enable only show it
|
// If only deleteFile is enable only show it
|
||||||
bool enableRemove = actions.contains(RemoveFile);
|
bool enableRemove = actions.contains(RemoveFile);
|
||||||
dd->m_removeFileAction->setEnabled(enableRemove);
|
m_removeFileAction->setEnabled(enableRemove);
|
||||||
bool enableDelete = actions.contains(EraseFile);
|
bool enableDelete = actions.contains(EraseFile);
|
||||||
dd->m_deleteFileAction->setEnabled(enableDelete);
|
m_deleteFileAction->setEnabled(enableDelete);
|
||||||
dd->m_deleteFileAction->setVisible(enableDelete);
|
m_deleteFileAction->setVisible(enableDelete);
|
||||||
|
|
||||||
dd->m_removeFileAction->setVisible(!enableDelete || enableRemove);
|
m_removeFileAction->setVisible(!enableDelete || enableRemove);
|
||||||
dd->m_renameFileAction->setEnabled(actions.contains(Rename));
|
m_renameFileAction->setEnabled(actions.contains(Rename));
|
||||||
|
|
||||||
DocumentManager::populateOpenWithMenu(dd->m_openWithMenu, ProjectTree::currentNode()->path());
|
DocumentManager::populateOpenWithMenu(m_openWithMenu, ProjectTree::currentNode()->path());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (actions.contains(HidePathActions)) {
|
if (actions.contains(HidePathActions)) {
|
||||||
dd->m_openTerminalHere->setVisible(false);
|
m_openTerminalHere->setVisible(false);
|
||||||
dd->m_showInGraphicalShell->setVisible(false);
|
m_showInGraphicalShell->setVisible(false);
|
||||||
dd->m_searchOnFileSystem->setVisible(false);
|
m_searchOnFileSystem->setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (actions.contains(HideFileActions)) {
|
if (actions.contains(HideFileActions)) {
|
||||||
dd->m_deleteFileAction->setVisible(false);
|
m_deleteFileAction->setVisible(false);
|
||||||
dd->m_removeFileAction->setVisible(false);
|
m_removeFileAction->setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (actions.contains(HideFolderActions)) {
|
if (actions.contains(HideFolderActions)) {
|
||||||
dd->m_addNewFileAction->setVisible(false);
|
m_addNewFileAction->setVisible(false);
|
||||||
dd->m_addNewSubprojectAction->setVisible(false);
|
m_addNewSubprojectAction->setVisible(false);
|
||||||
dd->m_removeProjectAction->setVisible(false);
|
m_removeProjectAction->setVisible(false);
|
||||||
dd->m_addExistingFilesAction->setVisible(false);
|
m_addExistingFilesAction->setVisible(false);
|
||||||
dd->m_addExistingDirectoryAction->setVisible(false);
|
m_addExistingDirectoryAction->setVisible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user