[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FileChooser private bookmarks doesn't seem to work


On Fri, 4 Oct 2024 at 12:28, Bruce Steers <bsteers4@xxxxxxxxx> wrote:

>
>
> On Fri, 4 Oct 2024 at 02:02, Bruce Steers <bsteers4@xxxxxxxxx> wrote:
>
>>
>>
>> I assume you are using GTK and that you mean the bookmark menu does not
>>> show as a MenuButton in the drop-down as documented at:
>>> https://gambaswiki.org/wiki/comp/gb.form/filechooser/bookmarks
>>>
>>> I used the code on that page and, with Qt5, get the same behavior as
>>> you. The Bookmarks menu item does not show.
>>>
>>
>> Yep , i followed the same instructions. with no success.  , pretty sure a
>> bug , i put on the bug tracker. I could't figure out the problem.
>> debugging the source i think the $hPrivate items are not updated, i put a
>> breakpoint where checks to add the $hPrivate contents but is seemed to only
>> do the check before i had set the items.
>>
>
> Aaaaah , Finally I figured it out :D
> https://gitlab.com/gambas/gambas/-/merge_requests/348
>
> Respects
> BruceS
>

Another discovery i have just found that gets this working before the fix.

the static Bookmarks.class (not documented in DirChooser wiki page, i will
add something)

Seems when using the DirChooser.Bookmarks Collection array as per the wiki
instructions this feature does not work (before the fix)

But if you use Bookmarks.class and add the bookmarks to that instead of
making the Collection then it does work as expected.

  If Exist("~/.config/gtk-3.0/bookmarks") Then
    For Each sLine As String In
Split(File.Load("~/.config/gtk-3.0/bookmarks"), "\n", Null, True)
      Dim aVar As String[] = Split(sLine, " ", Null, True)
      aVar.Insert(["", "", ""]) ' pad the array
      aVar[0] = Replace(FromUrl(aVar[0]), "file://", "")
      Bookmarks.Add(aVar[0], aVar[1], aVar[2])  ' use static Bookmarks.class
    Next
  Endif


Respects
BruceS

Follow-Ups:
Re: FileChooser private bookmarks doesn't seem to workBruce Steers <bsteers4@xxxxxxxxx>
References:
FileChooser private bookmarks doesn't seem to workBruce Steers <bsteers4@xxxxxxxxx>
Re: FileChooser private bookmarks doesn't seem to workT Lee Davidson <t.lee.davidson@xxxxxxxxx>
Re: FileChooser private bookmarks doesn't seem to workBruce Steers <bsteers4@xxxxxxxxx>
Re: FileChooser private bookmarks doesn't seem to workBruce Steers <bsteers4@xxxxxxxxx>