Opened 11 years ago

Closed 11 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:
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 11 years ago.
ROMFilePanel with BRefFilter inline

Download all attachments as: .zip

Change History (8)

by scanty, 11 years ago

Attachment: ROMFilePanel.h added

ROMFilePanel with BRefFilter inline

comment:1 by anevilyak, 11 years ago

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 by anevilyak, 11 years ago

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

in reply to:  2 comment:3 by scanty, 11 years ago

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 by anevilyak, 11 years ago

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 by anevilyak, 11 years ago

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 by anevilyak, 11 years ago

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

comment:7 by anevilyak, 11 years ago

Resolution: fixed
Status: in-progressclosed

Fixed in hrev45485.

Note: See TracTickets for help on using tickets.