After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 343120 - [Patch] Playlist name label not updated if playlist is renamed
[Patch] Playlist name label not updated if playlist is renamed
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: User Interface
git master
Other All
: Normal minor
: 2.x
Assigned To: Banshee Maintainers
Banshee Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-05-27 16:43 UTC by Denis Washington
Modified: 2006-06-13 15:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed Patch for Bug #343120 (5.24 KB, patch)
2006-05-27 16:48 UTC, Denis Washington
none Details | Review
Another proposed patch for bug #343120 (2.34 KB, patch)
2006-06-04 13:49 UTC, Denis Washington
none Details | Review
Proxy Updated event of child sources through the SourceManager (1.60 KB, patch)
2006-06-13 15:28 UTC, Aaron Bockover
committed Details | Review

Description Denis Washington 2006-05-27 16:43:15 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:
Comment 1 Denis Washington 2006-05-27 16:48:43 UTC
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.
Comment 2 Denis Washington 2006-05-27 17:07:45 UTC
Forgot changelog:

    * src/Banshee.Base/Source.cs:
    * src/Banshee.Base/SourceManager.cs: Update playlist name label if the
    currently opened playlist is renamed.
Comment 3 Patrick van Staveren 2006-06-03 07:12:58 UTC
Excellent patch, works perfectly.  Fixes a wee little bug introduced by child sources.

Looks ready to commit to me!
Comment 4 Aaron Bockover 2006-06-03 20:17:04 UTC
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.
Comment 5 Denis Washington 2006-06-04 13:09:17 UTC
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.
Comment 6 Denis Washington 2006-06-04 13:49:18 UTC
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...
Comment 7 Patrick van Staveren 2006-06-06 16:26:51 UTC
This looks much simpler, I like it!

Aaron?
Comment 8 Aaron Bockover 2006-06-13 15:20:38 UTC
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!
Comment 9 Aaron Bockover 2006-06-13 15:28:32 UTC
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!