MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / setupProjectMenu

Method setupProjectMenu

src/plugins/git/utils/gitmenumanager.cpp:73–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73void GitMenuManager::setupProjectMenu()
74{
75 auto mCurProject = ActionManager::instance()->actionContainer(M_GIT_PROJECT);
76 auto activeProjInfo = dpfGetService(dpfservice::ProjectService)->getActiveProjectInfo();
77 if (!activeProjInfo.isVaild() || !GitClient::instance()->checkRepositoryExist(activeProjInfo.workspaceFolder())) {
78 mCurProject->containerAction()->setEnabled(false);
79 return;
80 }
81
82 mCurProject->containerAction()->setEnabled(true);
83 QFileInfo info(activeProjInfo.workspaceFolder());
84
85 auto projectLogAct = ActionManager::instance()->command(A_GIT_LOG_PROJECT);
86 projectLogAct->setProperty(GitFilePath, activeProjInfo.workspaceFolder());
87 projectLogAct->action()->setText(tr("Log of \"%1\"").arg(info.fileName()));
88
89 auto projectDiffAct = ActionManager::instance()->command(A_GIT_DIFF_PROJECT);
90 projectDiffAct->setProperty(GitFilePath, activeProjInfo.workspaceFolder());
91 projectDiffAct->action()->setText(tr("Diff of \"%1\"").arg(info.fileName()));
92}
93
94void GitMenuManager::setupFileMenu(const QString &filePath)
95{

Callers 1

Calls 10

actionContainerMethod · 0.80
checkRepositoryExistMethod · 0.80
containerActionMethod · 0.80
fileNameMethod · 0.80
getActiveProjectInfoMethod · 0.45
setEnabledMethod · 0.45
commandMethod · 0.45
setPropertyMethod · 0.45
setTextMethod · 0.45
actionMethod · 0.45

Tested by

no test coverage detected