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)
|
2322 | 2322 | break; |
2323 | 2323 | |
2324 | 2324 | case kDelete: |
| 2325 | ExcludeTrashFromSelection(); |
2325 | 2326 | if (ContainerWindow()->IsTrash()) |
2326 | 2327 | // if trash delete instantly |
2327 | 2328 | DeleteSelection(true, false); |
… |
… |
BPoseView::MessageReceived(BMessage* message)
|
2331 | 2332 | |
2332 | 2333 | case kMoveToTrash: |
2333 | 2334 | { |
| 2335 | ExcludeTrashFromSelection(); |
2334 | 2336 | TrackerSettings settings; |
2335 | 2337 | |
2336 | 2338 | if ((modifiers() & B_SHIFT_KEY) != 0 || settings.DontMoveFilesToTrash()) |
… |
… |
BPoseView::KeyDown(const char* bytes, int32 count)
|
6466 | 6468 | |
6467 | 6469 | case B_DELETE: |
6468 | 6470 | { |
| 6471 | ExcludeTrashFromSelection(); |
6469 | 6472 | if (TargetModel() == NULL) { |
6470 | 6473 | // Happens if called from within OpenWith window, for example |
6471 | 6474 | break; |
… |
… |
BPoseView::ClearFilter()
|
10158 | 10161 | } |
10159 | 10162 | |
10160 | 10163 | |
| 10164 | void |
| 10165 | BPoseView::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 | |
10161 | 10178 | // #pragma mark - |
10162 | 10179 | |
10163 | 10180 | |
diff --git a/src/kits/tracker/PoseView.h b/src/kits/tracker/PoseView.h
index d1dd5ba..429c906 100644
a
|
b
|
class BPoseView : public BView {
|
679 | 679 | void WatchParentOf(const entry_ref*); |
680 | 680 | void StopWatchingParentsOf(const entry_ref*); |
681 | 681 | |
| 682 | void ExcludeTrashFromSelection(); |
| 683 | |
682 | 684 | private: |
683 | 685 | void DrawOpenAnimation(BRect); |
684 | 686 | |