extragear/multimedia/amarok/src/collection/sqlcollection

Daniel Winter dw at danielwinter.de
Sat Aug 2 01:46:20 CEST 2008


On Saturday 02 August 2008 00:16:26 Jeff Mitchell wrote:
> SVN commit 840827 by mitchell:
>
> Port the fileadded/filedeleted features of AFT over.  One question: how
> best to notify clients (like the playlist) of changed file status?  In 1.4
> it used a combination of path/UID -- both were necessary (and both still
> are, since either value can change).  But with Meta, can I avoid emits and
> signals/slots, and simply make a Meta pointer to the appropriate track,
> modify the UID and/or the URL inside that pointer, and be done with it?  If
> I can do this, then I still have to somehow notify clients that they need
> to check their Meta pointers and see if the files are still valid.
>
> If someone more familiar with Meta and shared pointers could help enlighten
> me, I'd appreciate it.
>

Well what I do in Nepomuk collection:

I monitor soprano for changes of the soprano model in nepomukregistry. When a 
change of the data of a file has happend I inform the NepomukTrack object about 
that change. 

If it is the url (the playable url)  I change the url and call 
notifyObservers().  The playlist then gets new playableUrl().  

The playlists stored in the sql database just hold the uidurls. When they get 
added to the current used playlist  trackForUrl() from the NepomuCollection 
gets called which returns the Meta::Track object.

The question is what about removed Tracks.   In current Playlist they won't 
playable anymore (isPlayable() returns false).  For the stored playlists in DB  
trackForUrl will not return anything so these tracks won't get loaded to the 
current playlist.

So I think you do not need any new methods except one for the SqlTrack class 
to inform the track about its changed location.

DanielW



More information about the Amarok-devel mailing list