| 29 | } |
| 30 | |
| 31 | void GitMenuManager::actionHandler(Command *cmd, GitType type) |
| 32 | { |
| 33 | const auto &filePath = cmd->property(GitFilePath).toString(); |
| 34 | bool isProject = cmd->property(GitIsProject).toBool(); |
| 35 | bool ret = false; |
| 36 | switch (type) { |
| 37 | case GitLog: |
| 38 | ret = GitClient::instance()->gitLog(filePath, isProject); |
| 39 | break; |
| 40 | case GitBlame: |
| 41 | ret = GitClient::instance()->blameFile(filePath); |
| 42 | break; |
| 43 | case GitDiff: |
| 44 | ret = GitClient::instance()->gitDiff(filePath, isProject); |
| 45 | default: |
| 46 | break; |
| 47 | } |
| 48 | |
| 49 | if (ret) { |
| 50 | if (!editSrv) |
| 51 | editSrv = dpfGetService(EditorService); |
| 52 | |
| 53 | editSrv->switchWidget(GitWindow); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | GitMenuManager *GitMenuManager::instance() |
| 58 | { |