Re: [Banshee-List] New INotify plugin - question re LibraryTrackRemovedArgs



On Sun, 2007-02-18 at 07:50 -0600, Mike Urbanski wrote:
> Jacob,
> 
> Hi.
> 
> > 1) I am probably missing something...?
> 
> No, you're right on from what I can remember.  If a single track was
> removed 'LibraryTrackRemovedArgs.Track' will be non-null, if multiple
> tracks were removed 'LibraryTrackRemovedArgs.Tracks' will be non-null.
> 
> Looking at the class def...
> 
> <snip>
>     public class LibraryTrackRemovedArgs : EventArgs
>     {
>         public LibraryTrackInfo Track;
>         public ICollection Tracks;
>     }
> </snip>
> 
> It is possible that both 'Track' and 'Tracks' could be null.  A
> modification to prevent this case could look something like the attached
> file...  Which is only an example, one that I haven't tested or even
> compiled.  Just an example.

Related to this is bug 354092 [1], which has a patch [2] to clean up
this mess. Feedback on that would be appreciated, currently it forces
every plugin writing to handle both cases (which are really the same).
Also, it currently has a very nasty type bug, the elements in the Tracks
member can be both TrackInfo objects and SafeUri objects. My patch makes
SafeUri objects impossible, as no plugin implements that (using
QueueRemove with a SafeUri argument would currently cause nasty
problems).

That patch is not a direct fix to the bug, but it'll help me a lot in
proving that the code we have is correct.

King regards,
	Ruben

[1]: http://bugzilla.gnome.org/show_bug.cgi?id=354092
[2]: http://bugzilla.gnome.org/attachment.cgi?id=82300


--
Ruben Vermeersch (rubenv)
http://www.savanne.be



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