Ticket #8820: 0001-tracker-exclude-trash-from-selection.patch

File 0001-tracker-exclude-trash-from-selection.patch, 2.0 KB (added by Freeman, 8 years ago)
  • src/kits/tracker/PoseView.cpp

    From 4e194033506b81dca3527ddf4e7b69df2ec878d7 Mon Sep 17 00:00:00 2001
    From: Freeman Lou <freemanlou2430@Yahoo.com>
    Date: Tue, 24 Dec 2013 14:47:45 +0000
    Subject: [PATCH] tracker exclude trash from selection
    
    ---
     src/kits/tracker/PoseView.cpp | 17 +++++++++++++++++
     src/kits/tracker/PoseView.h   |  2 ++
     2 files changed, 19 insertions(+)
    
    diff --git a/src/kits/tracker/PoseView.cpp b/src/kits/tracker/PoseView.cpp
    index 8ec8337..e4b57d3 100644
    a b BPoseView::MessageReceived(BMessage* message)  
    23222322            break;
    23232323
    23242324        case kDelete:
     2325            ExcludeTrashFromSelection();
    23252326            if (ContainerWindow()->IsTrash())
    23262327                // if trash delete instantly
    23272328                DeleteSelection(true, false);
    BPoseView::MessageReceived(BMessage* message)  
    23312332
    23322333        case kMoveToTrash:
    23332334        {
     2335            ExcludeTrashFromSelection();
    23342336            TrackerSettings settings;
    23352337
    23362338            if ((modifiers() & B_SHIFT_KEY) != 0 || settings.DontMoveFilesToTrash())
    BPoseView::KeyDown(const char* bytes, int32 count)  
    64666468
    64676469        case B_DELETE:
    64686470        {
     6471            ExcludeTrashFromSelection();
    64696472            if (TargetModel() == NULL) {
    64706473                // Happens if called from within OpenWith window, for example
    64716474                break;
    BPoseView::ClearFilter()  
    1015810161}
    1015910162
    1016010163
     10164void
     10165BPoseView::ExcludeTrashFromSelection()
     10166{
     10167    int32 count = fSelectionList->CountItems();
     10168    for (int index = 0; index < count; index++) {
     10169        BPose* pose = fSelectionList->ItemAt(index);
     10170        if (CanTrashForeignDrag(pose->TargetModel())) {
     10171            RemovePoseFromSelection(pose);
     10172            break;
     10173        }
     10174    }
     10175}
     10176
     10177
    1016110178//  #pragma mark -
    1016210179
    1016310180
  • src/kits/tracker/PoseView.h

    diff --git a/src/kits/tracker/PoseView.h b/src/kits/tracker/PoseView.h
    index d1dd5ba..429c906 100644
    a b class BPoseView : public BView {  
    679679        void WatchParentOf(const entry_ref*);
    680680        void StopWatchingParentsOf(const entry_ref*);
    681681
     682        void ExcludeTrashFromSelection();
     683
    682684    private:
    683685        void DrawOpenAnimation(BRect);
    684686