Opened 6 years ago

Closed 6 years ago

#9663 closed bug (fixed)

BRefFilter not Filtering

Reported by: scanty Owned by: anevilyak
Priority: normal Milestone: R1
Component: Kits/libtracker.so Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

Hello all. I am trying to use a BRefFilter in a BFilePanel, open mode. For whatever reason, Filter() is not being invoked, so the files displayed by the panel are never filtered, and simply pass right through the BRefFilter as if it wasn't there. I have attached a file so you can see what I am doing (wrong?). I know this code worked in BeOS 5, if that matters at all.

Attachments (1)

ROMFilePanel.h (1.6 KB) - added by scanty 6 years ago.
ROMFilePanel with BRefFilter inline

Download all attachments as: .zip

Change History (8)

Changed 6 years ago by scanty

Attachment: ROMFilePanel.h added

ROMFilePanel with BRefFilter inline

comment:1 Changed 6 years ago by anevilyak

The filter class itself looks ok. Without seeing how you're attaching it however, it's not possible to tell where you might be going wrong here. A simple test as follows invokes the filter correctly here though, which would seem to indicate that your problem is not the filter itself, but attaching it to the panel:

#include <Application.h>
#include <FilePanel.h>
#include <stdio.h>

#include "RomPanel.h"

int main(int, char **)
{
	BApplication app("application/x-vnd.blah-filepaneltest");

	BFilePanel* panel = new BFilePanel(B_OPEN_PANEL);
	panel->SetRefFilter(new ROMFilter());
	panel->Show();

	app.Run();

	return B_OK;
}

comment:2 Changed 6 years ago by anevilyak

Component: - GeneralKits/libtracker.so
Version: R1/alpha4.1R1/Development

comment:3 in reply to:  2 Changed 6 years ago by scanty

This is how I am adding it

ROMFilePanel::ROMFilePanel ()
	: BFilePanel (B_OPEN_PANEL, NULL, NULL, 0, false, NULL, NULL, true, true)
{
	Window()->Lock();
	
	SetRefFilter (new ROMFilter());
	
	// FIXME: hack.
	//SetPanelDirectory ("/void/roms/nes");
	//SetPanelDirectory ("/the dump/roms/nes");
	//fTempCart = new NESCart;
	
	Customize();
	
	Window()->Unlock();
}

comment:4 Changed 6 years ago by anevilyak

The above test works over here as well, so I'm not sure what to tell you. As a side note, you don't need the window locks there since the panel is constructed with the looper locked, and isn't unlocked until the panel is first shown.

comment:5 Changed 6 years ago by anevilyak

Aha....it appears to work only on the initial folder the panel shows, but doesn't seem to get invoked on folder switching...looking into that.

comment:6 Changed 6 years ago by anevilyak

Owner: changed from nobody to anevilyak
Status: newin-progress

comment:7 Changed 6 years ago by anevilyak

Resolution: fixed
Status: in-progressclosed

Fixed in hrev45485.

Note: See TracTickets for help on using tickets.