| 312 | } |
| 313 | |
| 314 | static void addNodeToMenu(const git::Index &index, QStringList &files, |
| 315 | const Node *node, bool staged, bool statusDiff) { |
| 316 | Debug("DoubleTreeWidgetr addNodeToMenu()" << node->name()); |
| 317 | |
| 318 | if (node->hasChildren()) { |
| 319 | for (auto child : node->children()) { |
| 320 | addNodeToMenu(index, files, child, staged, statusDiff); |
| 321 | } |
| 322 | |
| 323 | } else { |
| 324 | auto path = node->path(true); |
| 325 | |
| 326 | auto stageState = index.isStaged(path); |
| 327 | |
| 328 | if ((staged && stageState != git::Index::Unstaged) || |
| 329 | (!staged && stageState != git::Index::Staged) || !statusDiff) { |
| 330 | files.append(path); |
| 331 | } |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | void DoubleTreeWidget::showFileContextMenu(const QPoint &pos, RepoView *view, |
| 336 | QTreeView *tree, bool staged) { |