[haiku-3rdparty-dev] Showing and selecting a file in a Tracker window

  • From: "Humdinger" <dmarc-noreply@xxxxxxxxxxxxx> (Redacted sender "humdingerb" for DMARC)
  • To: haiku-3rdparty-dev@xxxxxxxxxxxxx
  • Date: Sat, 12 Aug 2017 18:22:42 +0200

Hi there!

I have an issue with a bit of code... see [1].
_OpenFolder() is supposed to open the folder fFolderRef and select the
file fFileRef. I lifted the code from Web+'s Downloads window [2].
While it works for Web+ it doesn't for Filer...

I checked with Debugger (screenshot [3]), fFolderRef and fFileRef are
vaild entry_refs. Though after selectionCommand.AddRef("refs",
&fFolderRef); the selectionCommand BMessage shows an empty "name".
Nevertheless, the right folder is opened in a Tracker window...(?) but
the file (fFileRef) isn't selected.

In Debugger, I cast the "nodeRefToSelect" of the selectionCommand from
void* to a node_ref and the device and node seems to be added
correctly.
What's my mistake?

Regards,
Humdinger

[1] 
https://github.com/humdingerb/Filer/blob/openfolder/sources/FolderPathView.cpp#L120
[2] 
http://xref.plausible.coop/source/xref/haiku/src/apps/webpositive/DownloadProgressView.cpp#532
[3] http://img.ctrlv.in/img/17/08/12/598f2af81fa8b.png

--
Did you know:
  If half the Haiku supporters at http://www.goodsearch.com
  made 10 searches a day, we could have a fulltime developer.

Other related posts: