xbmc/xbmc — pull request #1635 by Montellese (2012-10-17 09:13:38+00:00)
Title: media library: fix refreshing of item lists

The first commit is just convenience and I'll remove it from the PR if requested because it isn't really part of the fix.

The other two commits fix two issues:
* when refreshing (i.e. the path doesn't change) a list of items we almost completely replace CGUIMediaWindow::m_vecItems with the new CFileItemList instance and therefore we loose any details like custom properties added to a CFileItemList instance. Specifically this affects lists based on custom library nodes in the video library which use the filter functionality. We set a property "library.filter" on the resulting CFileItemList to know in CGUIMediaWindow that we need to select a specific CGUIViewState which also contains the "Sort by Playlist" option. Once the list is refreshed (e.g. after marking an item as watched) we loose that property and therefore change the CGUIViewState implementation we use and the sorting/presentation of the list can change.
* since we need the videodb:// and musicdb:// paths to be able to do the advanced filtering, we override the m_strPath value of a CFileItemList coming from a smartplaylist file (foo/bar.xsp) with the actual database-specific path upon retrieving the list from the database. This results in checks for CFileItem::IsSmartPlaylist() to not work properly anymore because it looks for a ".xsp" extension but the path now is e.g. "videodb://2/2?xsp=foobar". Similar to the "library.filter" property this can be solved by adding a "library.smartplaylist" property to the CFileItemList and extending CFileItem::IsSmartPlaylist() to also take that custom property into account. This (in combination with the other commit) fixes http://trac.xbmc.org/ticket/13412