No need to lock out the normal typeahead when filtering doesn't apply (i.e. in

icon mode). And a little automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35388 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2010-02-02 17:37:53 +00:00
parent e33d4e74c2
commit cc5b851813

View File

@ -771,8 +771,8 @@ BPoseView::SavePoseLocations(BRect *frameIfDesktop)
if (FSGetDeskDir(&dir) == B_OK) { if (FSGetDeskDir(&dir) == B_OK) {
const char *poseInfoAttr = isTrash ? kAttrTrashPoseInfo const char *poseInfoAttr = isTrash ? kAttrTrashPoseInfo
: kAttrDisksPoseInfo; : kAttrDisksPoseInfo;
const char *poseInfoAttrForeign = isTrash const char *poseInfoAttrForeign = isTrash
? kAttrTrashPoseInfoForeign ? kAttrTrashPoseInfoForeign
: kAttrDisksPoseInfoForeign; : kAttrDisksPoseInfoForeign;
if (dir.WriteAttr(poseInfoAttr, B_RAW_TYPE, 0, if (dir.WriteAttr(poseInfoAttr, B_RAW_TYPE, 0,
&poseInfo, sizeof(poseInfo)) == sizeof(poseInfo)) &poseInfo, sizeof(poseInfo)) == sizeof(poseInfo))
@ -1600,7 +1600,7 @@ BPoseView::CreateTrashPose()
BDirectory trash; BDirectory trash;
BEntry entry; BEntry entry;
node_ref ref; node_ref ref;
if (FSGetTrashDir(&trash, volume.Device()) == B_OK if (FSGetTrashDir(&trash, volume.Device()) == B_OK
&& trash.GetEntry(&entry) == B_OK && entry.GetNodeRef(&ref) == B_OK) { && trash.GetEntry(&entry) == B_OK && entry.GetNodeRef(&ref) == B_OK) {
WatchNewNode(&ref); WatchNewNode(&ref);
Model *model = new Model(&entry); Model *model = new Model(&entry);
@ -1878,7 +1878,7 @@ BPoseView::ShouldShowPose(const Model *model, const PoseInfo *poseInfo)
{ {
if (!PoseVisible(model, poseInfo)) if (!PoseVisible(model, poseInfo))
return false; return false;
// check filter before adding item // check filter before adding item
if (!fRefFilter) if (!fRefFilter)
return true; return true;
@ -2713,7 +2713,7 @@ BPoseView::ReadPoseInfo(Model *model, PoseInfo *poseInfo)
BModelOpener opener(model); BModelOpener opener(model);
if (!model->Node()) if (!model->Node())
return; return;
ReadAttrResult result = kReadAttrFailed; ReadAttrResult result = kReadAttrFailed;
BEntry entry; BEntry entry;
model->GetEntry(&entry); model->GetEntry(&entry);
@ -2724,9 +2724,9 @@ BPoseView::ReadPoseInfo(Model *model, PoseInfo *poseInfo)
if (model->IsRoot() || isTrash) { if (model->IsRoot() || isTrash) {
BDirectory dir; BDirectory dir;
if (FSGetDeskDir(&dir) == B_OK) { if (FSGetDeskDir(&dir) == B_OK) {
const char *poseInfoAttr = isTrash ? kAttrTrashPoseInfo const char *poseInfoAttr = isTrash ? kAttrTrashPoseInfo
: kAttrDisksPoseInfo; : kAttrDisksPoseInfo;
const char *poseInfoAttrForeign = isTrash ? kAttrTrashPoseInfoForeign const char *poseInfoAttrForeign = isTrash ? kAttrTrashPoseInfoForeign
: kAttrDisksPoseInfoForeign; : kAttrDisksPoseInfoForeign;
result = ReadAttr(&dir, poseInfoAttr, poseInfoAttrForeign, result = ReadAttr(&dir, poseInfoAttr, poseInfoAttrForeign,
B_RAW_TYPE, 0, poseInfo, sizeof(*poseInfo), &PoseInfo::EndianSwap); B_RAW_TYPE, 0, poseInfo, sizeof(*poseInfo), &PoseInfo::EndianSwap);
@ -6107,8 +6107,10 @@ BPoseView::KeyDown(const char *bytes, int32 count)
if (IsFilePanel()) if (IsFilePanel())
_inherited::KeyDown(bytes, count); _inherited::KeyDown(bytes, count);
else { else {
if (TrackerSettings().TypeAheadFiltering()) if (ViewMode() == kListMode
&& TrackerSettings().TypeAheadFiltering()) {
break; break;
}
if (fSelectionList->IsEmpty()) if (fSelectionList->IsEmpty())
sMatchString.Truncate(0); sMatchString.Truncate(0);
@ -6153,7 +6155,7 @@ BPoseView::KeyDown(const char *bytes, int32 count)
case B_BACKSPACE: case B_BACKSPACE:
{ {
if (TrackerSettings().TypeAheadFiltering()) { if (fFiltering) {
BString *lastString = fFilterStrings.LastItem(); BString *lastString = fFilterStrings.LastItem();
if (lastString->Length() == 0) { if (lastString->Length() == 0) {
int32 stringCount = fFilterStrings.CountItems(); int32 stringCount = fFilterStrings.CountItems();
@ -6193,7 +6195,8 @@ BPoseView::KeyDown(const char *bytes, int32 count)
{ {
// handle typeahead selection / filtering // handle typeahead selection / filtering
if (TrackerSettings().TypeAheadFiltering()) { if (ViewMode() == kListMode
&& TrackerSettings().TypeAheadFiltering()) {
if (key == ' ' && modifiers() & B_SHIFT_KEY) { if (key == ' ' && modifiers() & B_SHIFT_KEY) {
if (fFilterStrings.LastItem()->Length() == 0) if (fFilterStrings.LastItem()->Length() == 0)
break; break;