# # # patch "guitone/src/view/InventoryView.cpp" # from [892a8828e88a65b49cb2c280abe87c28eed70531] # to [126de4eea74e374aecc2b2e6871327a2700b6dda] # ============================================================ --- guitone/src/view/InventoryView.cpp 892a8828e88a65b49cb2c280abe87c28eed70531 +++ guitone/src/view/InventoryView.cpp 126de4eea74e374aecc2b2e6871327a2700b6dda @@ -96,10 +96,11 @@ void InventoryView::contextMenuEvent(QCo menu.addAction(actUnignore); } - if (item->isDirectory() || ( - item->hasNotStatus(InventoryItem::Unchanged) && - item->hasNotStatus(InventoryItem::Ignored) && - item->hasNotStatus(InventoryItem::Unknown))) + if (item->hasStatusRecursive(InventoryItem::Added) || + item->hasStatusRecursive(InventoryItem::Dropped) || + item->hasStatusRecursive(InventoryItem::Patched) || + item->hasStatusRecursive(InventoryItem::RenamedFrom) || + item->hasStatusRecursive(InventoryItem::RenamedTo)) { menu.addAction(actCommit); } @@ -109,17 +110,20 @@ void InventoryView::contextMenuEvent(QCo { menu.addAction(actRemove); menu.addAction(actRename); + + // as long as it is not unchanged, it can be converted + if (item->hasNotStatus(InventoryItem::Unchanged)) + { + menu.addAction(actRevert); + + // added files can't be diffed + if (item->hasNotStatus(InventoryItem::Added)) + { + menu.addAction(actDiff); + } + } } - // adds, drops, renames and changed files can be reverted - if (item->hasNotStatus(InventoryItem::Ignored) && - item->hasNotStatus(InventoryItem::Unchanged) && - item->hasNotStatus(InventoryItem::Unknown)) - { - menu.addAction(actRevert); - menu.addAction(actDiff); - } - // TODO: special items for directories to add/remove/commit/revert // items in subdirectories via getStatusRecursive and friends