GNOME Bugzilla – Bug 343120
[Patch] Playlist name label not updated if playlist is renamed
Last modified: 2006-06-13 15:28:59 UTC
Please describe the problem: If you open a playlist and rename the openend playlist, the label next to the search entry is not updated appropiately. I have attached a patch that fixes this issue. Steps to reproduce: 1. Create a new playlist 2. Open the playlist 3. Rename the opened playlist Actual results: The playlist name label is not updated. Expected results: The playlist name label should be updated. Does this happen every time? Yeah. Other information:
Created attachment 66337 [details] [review] Proposed Patch for Bug #343120 This patch includes a small API enhancement: class Source gets a new event "ChildSourceUpdated", which is needed fpr the SourceManager to be able to also redirect "Updated" events from child sources to PlayerInterface. The actual functionality for adjusting the playlist name label was already there, it was just never called for playlists from the library, which are child sources of the "Library" source and therefore weren't recognized by SourceManager.
Forgot changelog: * src/Banshee.Base/Source.cs: * src/Banshee.Base/SourceManager.cs: Update playlist name label if the currently opened playlist is renamed.
Excellent patch, works perfectly. Fixes a wee little bug introduced by child sources. Looks ready to commit to me!
I'm not so sure about this one. Why does there need to be a new event for the child source? It inherits the Updated event from the base Source class. Seems like a better patch to avoid unecessary API would be to make sure the source manager is aware of the child sources.
You mean by adding all children of a source if a source gets added to a source manager? I also thought of this possibility. I'll try to do a patch with this strategy too and post it when I'm finished.
Created attachment 66728 [details] [review] Another proposed patch for bug #343120 * src/Banshee.Base/SourceManager.cs: Let SourceManager recognize also child sources so the playlist name label is updated if the currently opened playlist is renamed. I just thought it may have been useful for other parts of Banshee to have an ChildSourceUpdated event, but please excuse me for being so impertinent to just add API in a patch...
This looks much simpler, I like it! Aaron?
This is somewhat close, but the problem here is that you're taking a child source and merging it into the source manager with normal "parent" sources... the source manager should be walkable like a tree, where the manager is the root, parent sources are directly owned by the manager, and child sources by their parents. You can see the problem with the patch by creating a new playlist. Cheers!
Created attachment 67265 [details] [review] Proxy Updated event of child sources through the SourceManager Dennis: you were very close. Instead of adding/removing the child source, all that's necessary is to attach/detach the SourceManager's Updated handler to proxy the event. I'm attaching the patch for record, but I have just committed it. Thanks!