Opened 9 years ago

Closed 12 days ago

#5026 closed bug (fixed)

List of folders keeps growing (easy)

Reported by: humdinger Owned by: jscipione
Priority: normal Milestone: R1
Component: Preferences/Backgrounds Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All


This is hrev34158.

When you invoke the Backgrounds add-on on a folder, or if you want to set a folder-background by invoking Backgrounds' drop-down menu "Other folder...", the folder gets added to the bottom of the drop-down menu.

It's like a recent folders list. Only, the list keeps growing with every selected folder. I think showing the number of folders defined with the "Recent Folders" setting, that's currently inside the Deskbar Preferences would be a good idea. No need for an awkward "Clean Folder List" menu item.

Maybe also a "Recent Folders" heading like in the "Favorites" menu of Save file dialogs.

Change History (15)

comment:1 Changed 9 years ago by korli

Owner: changed from korli to nobody

comment:2 Changed 4 years ago by pulkomandy

Summary: List of folders keeps growingList of folders keeps growing (easy)

comment:3 Changed 8 weeks ago by closequarters

Hello everyone, new to contributing to Haiku, but trying to pick something that seemed reasonably straightforward. This ticket seemed to fit the bill. After reviewing the code for the Backgrounds pref app and the Deskbar I think I have an idea how to fix this. My plan here is to load the Deskbar settings file using DeskbarUtils::GetDeskbarSettingsDirectory() as the starting path, retrieve the "recent files" setting, and then ensure that whenever the fWorkspaceMenu is added to in BackgroundView that I limit the total number of folder-specific entries in the menu to the same number in the Deskbar setting.

I've noticed there's a bunch of other tickets related to the Backgrounds pref app, I'm wondering if maybe someone was hoping to solve them all in one go and maybe that's why this ticket wasn't picked up yet? This ticket is quite old but I'm happy to work it if it's still valid. Thanks. (PS- I'll also sign up for the mailing lists etc but I wanted to start by making sure no one else was actively working this ticket)

comment:4 Changed 8 weeks ago by pulkomandy


As far as I know no one is currently working on the Backgrounds preferences. I think it's just that most people found other things more important for now. Your help is welcome and it looks like an easy place to start contributing.

Your approach looks correct. Maybe there should be an easier way for apps to retrieve the setting, but let's start with loading the settings file using DeskbarUtils and we'll see later on how to improve on this.

comment:6 Changed 7 weeks ago by Janus

I think if that setting is not universal there isn't a good reason to use that value in Background. Every app chooses that value and as korli point out Tracker has that settings but is not modifiable (I think the settings window had a FilePanel item in the past) now the value is stuck at 10.

Last edited 7 weeks ago by Janus (previous) (diff)

comment:7 Changed 7 weeks ago by closequarters

I'm perfectly happy having a constant "recent folders setting" value in the Backgrounds preflet, instead of pulling in the setting from the Deskbar. That certainly makes this ticket a lot simpler! I'll go with that approach unless anyone has objections. Seems like korli and janus are onboard.

comment:8 Changed 6 weeks ago by closequarters

Patch ready for code review: This is my first Haiku patch, so I'm sure I've missed something style wise, but I'm looking forward to feedback.

comment:9 Changed 4 weeks ago by closequarters

For the record, we settled on a constant value of 10 recent folders, which is defined within the Backgrounds preferences app itself. There are no references to Tracker or Deskbar in the patch for the ticket.

I did not add the "Recent folders" decorated file separator as suggested in the ticket description. While it would be possible to pull it in from the Tracker code (and I succeeded in doing so during my development), I was advised by my code reviewers on Gerrit not to make that change as part of this ticket.

Finally, my patch is nearly accepted on Gerrit. Would it be possible to assign me as owner of this ticket? I do not have rights to change ticket status or ownership. I would appreciate being the resolver on record.

comment:10 Changed 4 weeks ago by pulkomandy

It is not possible to assign tickets to people who did not get commit access yet. You will be credited for your changes by being author of the git commit (and a mention in the monthly activity report, once the changes are merged). Sorry about this.

comment:11 Changed 4 weeks ago by waddlesplash

Resolution: fixed
Status: newclosed

Merged as hrev52033. Thanks!

comment:12 Changed 13 days ago by jscipione

Resolution: fixed
Status: closedreopened

Reopening to fix the one missing piece of this which is to connect up the recent folders setting. The rest is all good. See for more details.

comment:13 Changed 13 days ago by jscipione

Owner: changed from nobody to jscipione
Status: reopenedin-progress

comment:14 Changed 12 days ago by closequarters

Can we close this again? The change proposed really has nothing to do with fixing the Backgrounds preflet folders growing. My change did indeed prevent the folder list from growing without end. If we want to update Backgrounds again so that we pull the "recent folder count" from somewhere else, that's fine by me but I think it should be a separate ticket

comment:15 Changed 12 days ago by waddlesplash

Resolution: fixed
Status: in-progressclosed


Note: See TracTickets for help on using tickets.